root/include/linux/kernel.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   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 #ifdef __KERNEL__
   9 
  10 #include <linux/config.h>
  11 
  12 #define VERIFY_READ 0
  13 #define VERIFY_WRITE 1
  14 
  15 int verify_area(int type, void * addr, unsigned long count);
  16 
  17 extern void math_error(void);
  18 volatile void panic(const char * str);
  19 volatile void do_exit(long error_code);
  20 unsigned long simple_strtoul(const char *,char **,unsigned int);
  21 int sprintf(char * buf, const char * fmt, ...);
  22 
  23 extern "C" int printk(const char * fmt, ...);
  24 
  25 #ifdef CONFIG_DEBUG_MALLOC
  26 #define kmalloc(a,b) deb_kmalloc(__FILE__,__LINE__, a,b)
  27 #define kfree_s(a,b) deb_kfree_s(__FILE__,__LINE__,a,b)
  28 
  29 void *deb_kmalloc(const char *deb_file, unsigned short deb_line,unsigned int size, int priority);
  30 void deb_kfree_s (const char *deb_file, unsigned short deb_line,void * obj, int size);
  31 void deb_kcheck_s(const char *deb_file, unsigned short deb_line,void * obj, int size);
  32 
  33 #define kfree(a) deb_kfree_s(__FILE__,__LINE__, a,0)
  34 #define kcheck(a) deb_kcheck_s(__FILE__,__LINE__, a,0)
  35 #define kcheck_s(a,b) deb_kcheck_s(__FILE__,__LINE__, a,b)
  36 
  37 #else /* !debug */
  38 
  39 void * kmalloc(unsigned int size, int priority);
  40 void kfree_s(void * obj, int size);
  41 
  42 #define kcheck_s(a,b) 0
  43 
  44 #define kfree(x) kfree_s((x), 0)
  45 #define kcheck(x) kcheck_s((x), 0)
  46 
  47 #endif
  48 
  49 
  50 /*
  51  * This is defined as a macro, but at some point this might become a
  52  * real subroutine that sets a flag if it returns true (to do
  53  * BSD-style accounting where the process is flagged if it uses root
  54  * privs).  The implication of this is that you should do normal
  55  * permissions checks first, and check suser() last.
  56  */
  57 #define suser() (current->euid == 0)
  58 
  59 #endif /* __KERNEL__ */
  60 
  61 #define SI_LOAD_SHIFT   16
  62 struct sysinfo {
  63         long uptime;                    /* Seconds since boot */
  64         unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
  65         unsigned long totalram;         /* Total usable main memory size */
  66         unsigned long freeram;          /* Available memory size */
  67         unsigned long sharedram;        /* Amount of shared memory */
  68         unsigned long bufferram;        /* Memory used by buffers */
  69         unsigned long totalswap;        /* Total swap space size */
  70         unsigned long freeswap;         /* swap space still available */
  71         unsigned short procs;           /* Number of current processes */
  72         char _f[22];                    /* Pads structure to 64 bytes */
  73 };
  74 
  75 #endif

/* [previous][next][first][last][top][bottom][index][help] */