|
|
1.1 root 1: /*-
2: * Copyright (c) 1982, 1988, 1991 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms, with or without
6: * modification, are permitted provided that the following conditions
7: * are met:
8: * 1. Redistributions of source code must retain the above copyright
9: * notice, this list of conditions and the following disclaimer.
10: * 2. Redistributions in binary form must reproduce the above copyright
11: * notice, this list of conditions and the following disclaimer in the
12: * documentation and/or other materials provided with the distribution.
13: * 3. All advertising materials mentioning features or use of this software
14: * must display the following acknowledgement:
15: * This product includes software developed by the University of
16: * California, Berkeley and its contributors.
17: * 4. Neither the name of the University nor the names of its contributors
18: * may be used to endorse or promote products derived from this software
19: * without specific prior written permission.
20: *
21: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: * SUCH DAMAGE.
32: *
1.1.1.3 ! root 33: * from: @(#)systm.h 7.17 (Berkeley) 5/25/91
! 34: * systm.h,v 1.13 1993/07/04 23:30:58 cgd Exp
1.1 root 35: */
36:
1.1.1.3 ! root 37: #ifndef _SYS_SYSTM_H_
! 38: #define _SYS_SYSTM_H_
! 39:
! 40: #include "param.h"
! 41: #include "types.h"
! 42:
! 43: struct sysent { /* system call table */
! 44: int sy_narg; /* number of arguments */
! 45: int (*sy_call)(); /* implementing function */
! 46: };
! 47:
! 48: #ifdef KERNEL
! 49:
! 50: extern struct sysent sysent[];
! 51:
! 52: /* Declare some stuff */
! 53: struct proc; struct vnode;
! 54:
! 55: extern const char *panicstr; /* panic message */
1.1 root 56: extern char version[]; /* system version */
57: extern char copyright[]; /* system copyright */
58:
59: extern int nblkdev; /* number of entries in bdevsw */
60: extern int nchrdev; /* number of entries in cdevsw */
61: extern int nswdev; /* number of swap devices */
62: extern int nswap; /* size of swap space */
63:
64: extern int selwait; /* select timeout address */
65:
66: extern u_char curpri; /* priority of current process */
67:
68: extern int maxmem; /* max memory per process */
69: extern int physmem; /* physical memory */
70:
71: extern dev_t dumpdev; /* dump device */
72: extern long dumplo; /* offset into dumpdev */
73:
74: extern dev_t rootdev; /* root device */
75: extern struct vnode *rootvp; /* vnode equivalent to above */
76:
77: extern dev_t swapdev; /* swapping device */
78: extern struct vnode *swapdev_vp;/* vnode equivalent to above */
79:
80: extern int boothowto; /* reboot flags, from console subsystem */
81: #ifdef KADB
82: extern char *bootesym; /* end of symbol info from boot */
83: #endif
84:
1.1.1.3 ! root 85: /* insque and remque */
! 86: #if defined(__GNUC__) && defined(notyet)
! 87: extern inline void
! 88: _insque(a, b)
! 89: void *a;
! 90: void *b;
! 91: {
! 92: register struct prochd *element = a, *head = b;
! 93: element->ph_link = head->ph_link;
! 94: head->ph_link = (struct proc *)element;
! 95: element->ph_rlink = (struct proc *)head;
! 96: ((struct prochd *)(element->ph_link))->ph_rlink=(struct proc *)element;
! 97: }
! 98:
! 99: extern inline void
! 100: _remque(a)
! 101: void *a;
! 102: {
! 103: register struct prochd *element = a;
! 104: ((struct prochd *)(element->ph_link))->ph_rlink = element->ph_rlink;
! 105: ((struct prochd *)(element->ph_rlink))->ph_link = element->ph_link;
! 106: element->ph_rlink = (struct proc *)0;
! 107: }
! 108: #else
! 109: #define insque(q,p) _insque((caddr_t)q,(caddr_t)p)
! 110: #define remque(q) _remque((caddr_t)q)
! 111: #endif /* __GNUC__ */
! 112:
! 113: typedef void (*timeout_t) __P((caddr_t));
1.1 root 114:
115: /*
116: * General function declarations.
117: */
1.1.1.3 ! root 118: int nullop(); /* WARNING WILL ROBINSON */
! 119: void voidop();
! 120: int enodev(); /* All these routines are potentially */
! 121: int enoioctl(); /* called with differing arguments. */
! 122: int enxio(); /* For this reason, they cannot be */
! 123: int eopnotsupp(); /* prototyped without causing conflicts. */
! 124:
! 125: /* SPL Levels */
! 126: int splhigh __P((void));
! 127: int splclock __P((void));
! 128: int splsoftclock __P((void));
! 129: int splbio __P((void));
! 130: int spltty __P((void));
! 131: int splimp __P((void));
! 132: int splnet __P((void));
! 133: int splnone __P((void));
! 134: int spl0 __P((void));
! 135: int splx __P((int));
! 136:
! 137: /* Initialize the world */
! 138: void startrtclock __P((void));
! 139: void consinit __P((void));
! 140: void vm_mem_init __P((void));
! 141: void kmeminit __P((void));
! 142: void cpu_startup __P((void));
! 143: void rqinit __P((void));
! 144: void vm_init_limits __P((struct proc *));
! 145: void vfsinit __P((void));
! 146: void mbinit __P((void));
! 147: void shminit __P((void));
! 148: void ifinit __P((void));
! 149: void domaininit __P((void));
! 150: void swapinit __P((void));
! 151: void enablertclock __P((void));
! 152:
! 153: /* Default network interfaces... */
! 154: int slattach __P((void)); /* XXX */
! 155: void loattach __P((void));
! 156:
! 157: /* Scheduling */
! 158: void roundrobin __P((caddr_t));
! 159: void schedcpu __P((caddr_t));
! 160: void softclock();
! 161: void setsoftclock __P((void));
! 162: void setpri __P((struct proc *));
! 163: void gatherstats(); /* cannot prototype */
! 164: void remrq __P((struct proc *));
! 165: void setrq __P((struct proc *));
! 166: void setrun __P((struct proc *));
! 167: void vmmeter __P((void));
! 168: void updatepri __P((struct proc *));
! 169: void swtch __P((void));
! 170:
! 171: /* Timeouts and sleeps */
! 172: void timeout __P((timeout_t, caddr_t, int));
! 173: void untimeout __P((timeout_t, caddr_t));
! 174: void wakeup __P((caddr_t));
! 175: int tsleep __P((caddr_t, int, const char *, int));
! 176: void sleep __P((caddr_t, int));
! 177: void unsleep __P((struct proc *));
! 178:
! 179: /* Select */
1.1.1.2 root 180: int selscan __P((struct proc *p, fd_set *ibits, fd_set *obits,
181: int nfd, int *retval));
1.1.1.3 ! root 182: int seltrue __P((int dev, int which, struct proc *p));
1.1 root 183:
1.1.1.3 ! root 184: /*
! 185: * if you want selrecord and selwakeup, and the struct selinfo declaration,
! 186: * include <sys/select.h>
! 187: */
1.1 root 188:
1.1.1.3 ! root 189: /* User data reference */
! 190: int useracc __P((caddr_t, int, int));
! 191: int kernacc __P((caddr_t, int, int));
1.1 root 192: int copystr __P((void *kfaddr, void *kdaddr, u_int len, u_int *done));
193: int copyinstr __P((void *udaddr, void *kaddr, u_int len, u_int *done));
194: int copyoutstr __P((void *kaddr, void *udaddr, u_int len, u_int *done));
195: int copyin __P((void *udaddr, void *kaddr, u_int len));
196: int copyout __P((void *kaddr, void *udaddr, u_int len));
197: int fubyte __P((void *base));
198: int fuibyte __P((void *base));
199: int subyte __P((void *base, int byte));
200: int suibyte __P((void *base, int byte));
201: int fuword __P((void *base));
202: int fuiword __P((void *base));
203: int suword __P((void *base, int word));
204: int suiword __P((void *base, int word));
205:
1.1.1.3 ! root 206: /* Miscellaneous */
! 207: void setregs __P((struct proc *p, u_long entry, u_long stack, int *retval));
! 208: void logwakeup __P((void));
! 209: void addlog __P((const char *, ...));
! 210: void log __P((int, const char *, ...));
! 211: int printf __P((const char *, ...));
! 212: int sprintf __P((char *, const char *, ...));
! 213: void uprintf __P((const char *, ...));
! 214: void tablefull __P((char *));
! 215:
! 216: /* Extrema */
! 217: unsigned int min __P((unsigned int, unsigned int));
! 218: unsigned int max __P((unsigned int, unsigned int));
! 219: int imin __P((int, int));
! 220: int imax __P((int, int));
! 221:
! 222: /* routines which never return */
! 223: __dead void sched __P((void));
! 224: __dead void kexit __P((struct proc *, int)); /* change from exit, so it
! 225: * doesn't conflict w/ANSI
! 226: */
! 227: __dead void cpu_exit __P((struct proc *));
! 228: __dead void panic __P((const char *));
! 229: __dead void boot __P((int));
! 230:
! 231: /* string functions */
! 232: size_t strlen __P((const char *));
! 233: int strcmp __P((const char *, const char *));
! 234: char *strncpy __P((char *, const char *, int));
! 235: char *strcat __P((char *, const char *));
! 236: char *strcpy __P((char *, const char *));
! 237: void bcopy __P((void *from, void *to, u_int len));
! 238: void ovbcopy __P((void *from, void *to, u_int len));
! 239: void bzero __P((void *, u_int));
! 240: int bcmp __P((void *str1, void *str2, u_int len));
1.1 root 241: int scanc __P((unsigned size, u_char *cp, u_char *table, int mask));
1.1.1.3 ! root 242: int skpc __P((int, u_int, u_char *));
! 243: int locc __P((int, unsigned, u_char *));
! 244: int ffs __P((long));
! 245:
! 246: /* Debugger entry points */
! 247: int Debugger __P((void)); /* in DDB only */
! 248: int read_symtab_from_file __P((struct proc *,struct vnode *,const char *));
! 249:
! 250: #endif /* KERNEL */
! 251: #endif /* _SYS_SYSTM_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.