xref: /original-bsd/sys/sys/systm.h (revision bafc759a)
1 /*-
2  * Copyright (c) 1982, 1988, 1991 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)systm.h	7.18 (Berkeley) 11/01/91
8  */
9 
10 extern const char *panicstr;	/* panic message */
11 extern char version[];		/* system version */
12 extern char copyright[];	/* system copyright */
13 
14 extern int nblkdev;		/* number of entries in bdevsw */
15 extern int nchrdev;		/* number of entries in cdevsw */
16 extern int nswdev;		/* number of swap devices */
17 extern int nswap;		/* size of swap space */
18 
19 extern int selwait;		/* select timeout address */
20 
21 extern u_char curpri;		/* priority of current process */
22 
23 extern int maxmem;		/* max memory per process */
24 extern int physmem;		/* physical memory */
25 
26 extern dev_t dumpdev;		/* dump device */
27 extern long dumplo;		/* offset into dumpdev */
28 
29 extern dev_t rootdev;		/* root device */
30 extern struct vnode *rootvp;	/* vnode equivalent to above */
31 
32 extern dev_t swapdev;		/* swapping device */
33 extern struct vnode *swapdev_vp;/* vnode equivalent to above */
34 
35 extern struct sysent {		/* system call table */
36 	int	sy_narg;	/* number of arguments */
37 	int	(*sy_call)();	/* implementing function */
38 } sysent[];
39 
40 extern int boothowto;		/* reboot flags, from console subsystem */
41 #ifdef	KADB
42 extern char *bootesym;		/* end of symbol info from boot */
43 #endif
44 
45 /* casts to keep lint happy */
46 #define	insque(q,p)	_insque((caddr_t)q,(caddr_t)p)
47 #define	remque(q)	_remque((caddr_t)q)
48 
49 /*
50  * General function declarations.
51  */
52 int	nullop __P((void));
53 int	enodev __P((void));
54 int	enoioctl __P((void));
55 int	enxio __P((void));
56 int	eopnotsupp __P((void));
57 int	seltrue __P((dev_t dev, int which, struct proc *p));
58 
59 void	panic __P((const char *, ...));
60 void	tablefull __P((char *));
61 void	addlog __P((const char *, ...));
62 void	log __P((int, const char *, ...));
63 void	printf __P((const char *, ...));
64 int	sprintf __P((char *buf, const char *, ...));
65 void	ttyprintf __P((struct tty *, const char *, ...));
66 
67 void	bcopy __P((void *from, void *to, u_int len));
68 void	ovbcopy __P((void *from, void *to, u_int len));
69 void	bzero __P((void *buf, u_int len));
70 int	bcmp __P((void *str1, void *str2, u_int len));
71 int	strlen __P((char *string));
72 
73 int	copystr __P((void *kfaddr, void *kdaddr, u_int len, u_int *done));
74 int	copyinstr __P((void *udaddr, void *kaddr, u_int len, u_int *done));
75 int	copyoutstr __P((void *kaddr, void *udaddr, u_int len, u_int *done));
76 int	copyin __P((void *udaddr, void *kaddr, u_int len));
77 int	copyout __P((void *kaddr, void *udaddr, u_int len));
78 
79 int	fubyte __P((void *base));
80 #ifdef notdef
81 int	fuibyte __P((void *base));
82 #endif
83 int	subyte __P((void *base, int byte));
84 int	suibyte __P((void *base, int byte));
85 int	fuword __P((void *base));
86 int	fuiword __P((void *base));
87 int	suword __P((void *base, int word));
88 int	suiword __P((void *base, int word));
89 
90 int	scanc __P((unsigned size, u_char *cp, u_char *table, int mask));
91 int	skpc __P((int mask, int size, char *cp));
92 int	locc __P((int mask, char *cp, unsigned size));
93 int	ffs __P((long value));
94