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