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