1 #ifndef_LINUX_KERNEL_H 2 #define_LINUX_KERNEL_H 3
4 /* 5 * 'kernel.h' contains some often-used function prototypes etc 6 */ 7
8 #defineVERIFY_READ 0
9 #defineVERIFY_WRITE 1
10
11 intverify_area(inttype, void * addr, unsignedlongcount);
12
13 volatilevoidpanic(constchar * str);
14 volatilevoiddo_exit(longerror_code);
15 unsignedlongsimple_strtoul(constchar *,char **,unsignedint);
16 intsprintf(char * buf, constchar * fmt, ...);
17 intprintk(constchar * fmt, ...);
18
19 void * kmalloc(unsignedintsize, intpriority);
20 voidkfree_s(void * obj, intsize);
21
22 #definekfree(x) kfree_s((x), 0)
23
24 /* 25 * This is defined as a macro, but at some point this might become a 26 * real subroutine that sets a flag if it returns true (to do 27 * BSD-style accounting where the process is flagged if it uses root 28 * privs). The implication of this is that you should do normal 29 * permissions checks first, and check suser() last. 30 */ 31 #definesuser() (current->euid == 0)
32
33 #defineSI_LOAD_SHIFT 16
34 structsysinfo{ 35 longuptime; /* Seconds since boot */ 36 unsignedlongloads[3]; /* 1, 5, and 15 minute load averages */ 37 unsignedlongtotalram; /* Total usable main memory size */ 38 unsignedlongfreeram; /* Available memory size */ 39 unsignedlongsharedram; /* Amount of shared memory */ 40 unsignedlongbufferram; /* Memory used by buffers */ 41 unsignedlongtotalswap; /* Total swap space size */ 42 unsignedlongfreeswap; /* swap space still available */ 43 unsignedshortprocs; /* Number of current processes */ 44 char _f[22]; /* Pads structure to 64 bytes */ 45 };
46
47 #endif