Copy wininet to branch
[reactos.git] / reactos / drivers / lib / oskittcp / include / freebsd / src / sys / sys / systm.h
1 /*-
2 * Copyright (c) 1982, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
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 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)systm.h 8.4 (Berkeley) 2/23/94
39 */
40
41 #ifndef _SYS_SYSTM_H_
42 #define _SYS_SYSTM_H_
43
44 #include <machine/cpufunc.h>
45 #include <machine/stdarg.h>
46
47 /*
48 * The `securelevel' variable controls the security level of the system.
49 * It can only be decreased by process 1 (/sbin/init).
50 *
51 * Security levels are as follows:
52 * -1 permannently insecure mode - always run system in level 0 mode.
53 * 0 insecure mode - immutable and append-only flags make be turned off.
54 * All devices may be read or written subject to permission modes.
55 * 1 secure mode - immutable and append-only flags may not be changed;
56 * raw disks of mounted filesystems, /dev/mem, and /dev/kmem are
57 * read-only.
58 * 2 highly secure mode - same as (1) plus raw disks are always
59 * read-only whether mounted or not. This level precludes tampering
60 * with filesystems by unmounting them, but also inhibits running
61 * newfs while the system is secured.
62 *
63 * In normal operation, the system runs in level 0 mode while single user
64 * and in level 1 mode while multiuser. If level 2 mode is desired while
65 * running multiuser, it can be set in the multiuser startup script
66 * (/etc/rc.local) using sysctl(1). If it is desired to run the system
67 * in level 0 mode while multiuser, initialize the variable securelevel
68 * in /sys/kern/kern_sysctl.c to -1. Note that it is NOT initialized to
69 * zero as that would allow the kernel binary to be patched to -1.
70 * Without initialization, securelevel loads in the BSS area which only
71 * comes into existence when the kernel is loaded and hence cannot be
72 * patched by a stalking hacker.
73 */
74 extern int securelevel; /* system security level */
75
76 extern int cold; /* nonzero if we are doing a cold boot */
77 extern const char *panicstr; /* panic message */
78 extern char version[]; /* system version */
79 extern char copyright[]; /* system copyright */
80
81 extern int nblkdev; /* number of entries in bdevsw */
82 extern int nchrdev; /* number of entries in cdevsw */
83 extern struct swdevt *swdevt; /* swap-device information */
84 extern int nswdev; /* number of swap devices */
85 extern int nswap; /* size of swap space */
86
87 extern int selwait; /* select timeout address */
88
89 extern u_char curpriority; /* priority of current process */
90
91 extern int physmem; /* physical memory */
92
93 extern dev_t dumpdev; /* dump device */
94 extern long dumplo; /* offset into dumpdev */
95
96 extern dev_t rootdev; /* root device */
97 extern struct vnode *rootvp; /* vnode equivalent to above */
98
99 extern dev_t swapdev; /* swapping device */
100 extern struct vnode *swapdev_vp;/* vnode equivalent to above */
101
102 extern int boothowto; /* reboot flags, from console subsystem */
103
104 /*
105 * General function declarations.
106 */
107 int nullop __P((void));
108 int enodev __P((void));
109 int enoioctl __P((void));
110 int enxio __P((void));
111 int eopnotsupp __P((void));
112 int seltrue __P((dev_t dev, int which, struct proc *p));
113 int ureadc __P((int, struct uio *));
114 void *hashinit __P((int count, int type, u_long *hashmask));
115 void *phashinit __P((int count, int type, u_long *nentries));
116
117 __dead void panic __P((const char *, ...)) __dead2;
118 __dead void boot __P((int)) __dead2;
119 void tablefull __P((const char *));
120 void addlog __P((const char *, ...));
121 #ifndef __REACTOS__
122 void log __P((int, const char *, ...));
123 void printf __P((const char *, ...));
124 #else
125 #include <oskitfreebsd.h>
126 #include <oskitdebug.h>
127
128
129 int __cdecl vprintf(const char *, va_list);
130
131 #define log bsd_log
132 static inline int bsd_log ( int blah, const char* fmt, ... )
133 {
134 va_list arg;
135 int i;
136 va_start(arg, fmt);
137 #ifndef __NTDRIVER__
138 i = vprintf ( fmt, arg );
139 #endif
140 va_end(arg);
141 return i;
142 }
143 #endif
144 void uprintf __P((const char *, ...));
145 int sprintf __P((char *buf, const char *, ...));
146 void ttyprintf __P((struct tty *, const char *, ...));
147 void kprintf __P((const char *fmt, int flags, struct tty *tp, va_list ap));
148
149 #ifndef __REACTOS__
150 void bcopy __P((const void *from, void *to, size_t len));
151 #endif
152 void ovbcopy __P((const void *from, void *to, size_t len));
153 void blkclr __P((void *buf, u_int len));
154 void bzero __P((void *buf, size_t len));
155
156 #ifndef __REACTOS__
157 void *memcpy __P((void *to, const void *from, size_t len));
158 #endif
159
160 int copystr __P((void *kfaddr, void *kdaddr, u_int len, u_int *done));
161 int copyinstr __P((void *udaddr, void *kaddr, u_int len, u_int *done));
162 int copyoutstr __P((void *kaddr, void *udaddr, u_int len, u_int *done));
163 int copyin __P((void *udaddr, void *kaddr, u_int len));
164 int copyout __P((void *kaddr, void *udaddr, u_int len));
165
166 int fubyte __P((void *base));
167 int fuibyte __P((void *base));
168 int subyte __P((void *base, int byte));
169 int suibyte __P((void *base, int byte));
170 int fuword __P((void *base));
171 int fuiword __P((void *base));
172 int suword __P((void *base, int word));
173 int susword __P((void *base, int word));
174 int suiword __P((void *base, int word));
175
176 int hzto __P((struct timeval *tv));
177 void realitexpire __P((void *));
178
179 struct clockframe;
180 void hardclock __P((struct clockframe *frame));
181 void softclock __P((void));
182 void statclock __P((struct clockframe *frame));
183
184 void initclocks __P((void));
185
186 void startprofclock __P((struct proc *));
187 void stopprofclock __P((struct proc *));
188 void setstatclockrate __P((int hzrate));
189
190 void hardupdate __P((long));
191 #include <sys/libkern.h>
192
193 /* Initialize the world */
194 extern void consinit(void);
195 extern void kmeminit(void);
196 extern void cpu_startup(void);
197 extern void usrinfoinit(void);
198 extern void rqinit(void);
199 extern void vfsinit(void);
200 extern void mbinit(void);
201 extern void clist_init(void);
202 extern void ifinit(void);
203 extern void domaininit(void);
204 extern void cpu_initclocks(void);
205 extern void vntblinit(void);
206 extern void nchinit(void);
207
208 /* Finalize the world. */
209 void shutdown_nice __P((void));
210
211 extern __dead void vm_pageout(void) __dead2; /* pagedaemon, called in proc 2 */
212 extern __dead void vfs_update(void) __dead2; /* update, called in proc 3 */
213 extern __dead void scheduler(void) __dead2; /* sched, called in process 0 */
214
215 /*
216 * Kernel to clock driver interface.
217 */
218 void inittodr __P((time_t base));
219 void resettodr __P((void));
220 void startrtclock __P((void));
221
222 /* Timeouts */
223 typedef void (timeout_t)(void *); /* actual timeout function type */
224 typedef timeout_t *timeout_func_t; /* a pointer to this type */
225
226 void timeout(timeout_func_t, void *, int);
227 void untimeout(timeout_func_t, void *);
228 void logwakeup __P((void));
229
230 /* Syscalls that are called internally. */
231 struct close_args {
232 int fd;
233 };
234 int close __P((struct proc *, struct close_args *uap, int *retval));
235 struct execve_args {
236 char *fname;
237 char **argv;
238 char **envv;
239 };
240 int execve __P((struct proc *, struct execve_args *, int *retval));
241 struct fork_args {
242 int dummy;
243 };
244 int fork __P((struct proc *, struct fork_args *, int retval[]));
245 struct sync_args {
246 int dummy;
247 };
248 int sync __P((struct proc *, struct sync_args *, int *retval));
249 struct wait_args {
250 int pid;
251 int *status;
252 int options;
253 struct rusage *rusage;
254 #if defined(COMPAT_43) || defined(COMPAT_IBCS2)
255 int compat; /* pseudo */
256 #endif
257 };
258 int wait1 __P((struct proc *, struct wait_args *, int retval[]));
259
260 #endif /* !_SYS_SYSTM_H_ */