1 /* 2 * Copyright (c) 1993 William Jolitz. All rights reserved. 3 * Written by William Jolitz 1/93 4 * 5 * Redistribution and use in source and binary forms are freely permitted 6 * provided that the above copyright notice and attribution and date of work 7 * and this paragraph are duplicated in all such forms. 8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 10 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11 * 12 * 13 * $Id: prototypes.h,v 1.1 95/02/20 19:45:13 bill Exp Locker: bill $ 14 * 15 * Machine independant kernel function prototypes. 16 */ 17 18 /* forward declarations */ 19 struct proc; 20 struct user; 21 struct pcb; 22 23 /* interface symbols */ 24 #define __ISYM_VERSION__ "1" /* XXX RCS major revision number of hdr file */ 25 #include "isym.h" /* this header has interface symbols */ 26 27 __ISYM__(int, nullop, (void)) 28 int _ENODEV_ (void); /* XXX: need to generate dynamically */ 29 int _ENOSYS_ (void); 30 int _ENOTTY_ (void); 31 int _ENXIO_ (void); 32 int _EOPNOTSUPP_ (void); 33 __ISYM__(int, seltrue, (dev_t dev, int which, struct proc *p)) 34 void selwakeup(pid_t pid, int coll); 35 36 __ISYM__(void, panic, (const char *)) 37 __ISYM__(void, tablefull, (char *)) 38 void addlog (const char *, ...); 39 __ISYM__(void, log, (int, const char *, ...)) 40 __ISYM__(void, printf, (const char *, ...)) 41 __ISYM__(void, uprintf, (const char *, ...)) 42 int sprintf (char *buf, const char *, ...); 43 void ttyprintf (struct tty *, const char *, ...); 44 45 int memcmp (const void *, const void *, size_t); 46 void *memcpy (void *, const void *, size_t); 47 __ISYM__(void *, memmove, (void *, const void *, size_t)) 48 void *memset (void *, int, size_t); 49 50 char *strcat (char *, const char *); 51 char *strcpy (char *, const char *); 52 size_t strlen (const char *); 53 char *strncpy (char *, const char *, size_t); 54 55 int copystr (void *kfaddr, void *kdaddr, u_int len, u_int *done); 56 int copyinstr (struct proc *, void *udaddr, void *kaddr, u_int len, u_int *done); 57 int copyoutstr (struct proc *, void *kaddr, void *udaddr, u_int len, u_int *done); 58 __ISYM__(int, copyin, (struct proc *, void *udaddr, void *kaddr, u_int len)) 59 __ISYM__(int, copyout, (struct proc *, void *kaddr, void *udaddr, u_int len)) 60 61 #ifdef notdef 62 int fubyte (void *base); 63 int fuibyte (void *base); 64 int subyte (void *base, int byte); 65 int suibyte (void *base, int byte); 66 int fuword (void *base); 67 int fuiword (void *base); 68 int suword (void *base, int word); 69 int suiword (void *base, int word); 70 #endif 71 72 int scanc (unsigned size, u_char *cp, u_char *table, int mask); 73 int skpc (int mask, int size, char *cp); 74 int locc (int mask, char *cp, unsigned size); 75 int ffs (long value); 76 77 #ifdef _CPU_H_ 78 void hardclock(clockframe frame); 79 void gatherstats(clockframe frame); 80 void softclock(clockframe frame); 81 #endif 82 83 __ISYM__(void, timeout, (int (*func)(), caddr_t arg, int t)) 84 void untimeout(int (*func)(), caddr_t arg); 85 86 #ifdef _SYS_TIME_H_ 87 int hzto(struct timeval *tv); 88 void realitexpire(struct proc *p); 89 int itimerfix(struct timeval *tv); 90 int itimerdecr(struct itimerval *itp, int usec); 91 void timevaladd(struct timeval *t1, struct timeval *t2); 92 void timevalsub(struct timeval *t1, struct timeval *t2); 93 void timevalfix(struct timeval *t1); 94 #endif 95 96 /* 97 * Machine dependant function prototypes 98 */ 99 #include "machine/prototypes.h" 100 101 /* 102 * Inline functions 103 */ 104 #include "queue.h" 105 #define insque(n, h) _insque((queue_t) n, (queue_t) h) 106 #define remque(n) _remque((queue_t) n) 107 108 /*__BEGIN_DECLS 109 __END_DECLS */ 110 111 #undef __ISYM__ 112 #undef __ISYM_ALIAS__ 113 #undef __ISYM_VERSION__ 114 115 #include "machine/inline/string.h" 116 #include "machine/inline/kernel.h" 117