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 9 10 #define SI_LOAD_SHIFT 16 11 struct sysinfo { 12 long uptime; /* Seconds since boot */ 13 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ 14 unsigned long totalram; /* Total usable main memory size */ 15 unsigned long freeram; /* Available memory size */ 16 unsigned long sharedram; /* Amount of shared memory */ 17 unsigned long bufferram; /* Memory used by buffers */ 18 unsigned long totalswap; /* Total swap space size */ 19 unsigned long freeswap; /* swap space still available */ 20 unsigned short procs; /* Number of current processes */ 21 unsigned short pad; /* explicit padding for m68k */ 22 unsigned long totalhigh; /* Total high memory size */ 23 unsigned long freehigh; /* Available high memory size */ 24 unsigned int mem_unit; /* Memory unit size in bytes */ 25 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ 26 }; 27 28 /* Force a compilation error if condition is true */ 29 #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) 30 31 /* Force a compilation error if condition is constant and true */ 32 #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) 33 34 /* Force a compilation error if condition is true, but also produce a 35 result (of value 0 and type size_t), so the expression can be used 36 e.g. in a structure initializer (or where-ever else comma expressions 37 aren't permitted). */ 38 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) 39 #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) 40 41 /* Trap pasters of __FUNCTION__ at compile-time */ 42 #define __FUNCTION__ (__func__) 43 44 /* This helps us to avoid #ifdef CONFIG_NUMA */ 45 #ifdef CONFIG_NUMA 46 #define NUMA_BUILD 1 47 #else 48 #define NUMA_BUILD 0 49 #endif 50 51 /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ 52 #ifdef CONFIG_FTRACE_MCOUNT_RECORD 53 # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 54 #endif 55 56 #endif 57