Home | History | Annotate | Line # | Download | only in kern
compat_stub.c revision 1.1.2.22
      1 /* $NetBSD: compat_stub.c,v 1.1.2.22 2018/09/21 02:56:22 pgoyette Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 2018 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Paul Goyette
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 #include <sys/cdefs.h>
     33 
     34 #ifdef _KERNEL_OPT
     35 #include "opt_ntp.h"
     36 #endif
     37 
     38 #include <sys/systm.h>
     39 #include <sys/compat_stub.h>
     40 
     41 #ifdef NTP
     42 #include <sys/timespec.h>
     43 #include <sys/timex.h>
     44 #endif
     45 
     46 /*
     47  * Routine vectors for compat_50___sys_ntp_gettime
     48  *
     49  * MP-hooks not needed since the NTP code is not modular
     50  */
     51 
     52 #ifdef NTP
     53 void (*vec_ntp_gettime)(struct ntptimeval *) = ntp_gettime;
     54 int (*vec_ntp_timestatus)(void) = ntp_timestatus;
     55 #else
     56 void (*vec_ntp_gettime)(struct ntptimeval *) = NULL;
     57 int (*vec_ntp_timestatus)(void) = NULL;
     58 #endif
     59 
     60 /*
     61  * usb device_info compatability
     62  */
     63 struct usb_subr_30_hook_t usb_subr_30_hook;
     64 
     65 /*
     66  * ccd device compatability ioctl
     67  */
     68 
     69 struct ccd_ioctl_60_hook_t ccd_ioctl_60_hook;
     70 
     71 /*
     72  * clockctl device compatability ioctl
     73  */
     74 
     75 struct clockctl_ioctl_50_hook_t clockctl_ioctl_50_hook;
     76 
     77 /*
     78  * if_sppp device compatability ioctl subroutine
     79  */
     80 
     81 struct sppp_params_50_hook_t sppp_params_50_hook;
     82 
     83 /*
     84  * cryptodev compatability ioctl
     85  */
     86 
     87 struct ocryptof_50_hook_t ocryptof_50_hook;
     88 
     89 /*
     90  * raidframe compatability
     91  */
     92 struct raidframe50_ioctl_hook_t raidframe50_ioctl_hook;
     93 struct raidframe80_ioctl_hook_t raidframe80_ioctl_hook;
     94 
     95 /*
     96  * puffs compatability
     97  */
     98 
     99 struct puffs50_compat_hook_t puffs50_compat_hook;
    100 
    101 int (*puffs50_compat_outgoing)(struct puffs_req *, struct puffs_req **,
    102     ssize_t *) = (void *)enosys;
    103 void (*puffs50_compat_incoming)(struct puffs_req *, struct puffs_req *) =
    104     (void *)voidop;
    105 
    106 /*
    107  * wsevents compatability
    108  */
    109 struct wsevent_50_copyout_events_hook_t wsevent_50_copyout_events_hook;
    110 
    111 /*
    112  * sysmon_power compatability
    113  */
    114 struct compat_sysmon_power_40_hook_t compat_sysmon_power_40_hook;
    115 
    116 /*
    117  * compat_bio compatability
    118  */
    119 struct compat_bio_30_hook_t compat_bio_30_hook;
    120 
    121 /*
    122  * vnd ioctl compatability
    123  */
    124 struct compat_vndioctl_30_hook_t compat_vndioctl_30_hook;
    125 struct compat_vndioctl_50_hook_t compat_vndioctl_50_hook;
    126 
    127 /*
    128  * ieee80211 ioctl compatability
    129  */
    130 struct ieee80211_ostats_hook_t ieee80211_ostats_hook;
    131 struct ieee80211_get_ostats_20_hook_t ieee80211_get_ostats_20_hook;
    132 
    133 /*XXX PRG */int (*ieee80211_get_ostats_20)(struct ieee80211_ostats *,
    134     struct ieee80211_stats *) = (void *)enosys;
    135 
    136 /*
    137  * if_43 compatability
    138  */
    139 struct if_43_hook_t if_43_hook;
    140 
    141 /*
    142  * if43_20 compatability
    143  */
    144 struct if43_20_hook_t if43_20_hook;
    145 
    146 /*
    147  * upic_syscalls_40 compatability
    148  */
    149 struct uipc_syscalls_40_hook_t uipc_syscalls_40_hook;
    150 
    151 /*
    152  * upic_syscalls_50 compatability
    153  */
    154 struct uipc_syscalls_50_hook_t uipc_syscalls_50_hook;
    155 
    156 /*
    157  * rtsock 14 compatability
    158  */
    159 struct rtsock14_hook_t rtsock14_hook;
    160 
    161 /*
    162  * modctl handler for old style OSTAT
    163  */
    164 struct compat_modstat_80_hook_t compat_modstat_80_hook;
    165 
    166 /*
    167  * mask for kern_sig_43's killpg (updated by compat_09)
    168  */
    169 int kern_sig_43_pgid_mask = ~0;
    170