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 <stdarg.h>
  11 #include <linux/linkage.h>
  12 
  13 /* Optimization barrier */
  14 #define barrier() __asm__("": : :"memory")
  15 
  16 #define INT_MAX         ((int)(~0U>>1))
  17 #define UINT_MAX        (~0U)
  18 #define LONG_MAX        ((long)(~0UL>>1))
  19 #define ULONG_MAX       (~0UL)
  20 
  21 #define STACK_MAGIC     0xdeadbeef
  22 
  23 #define KERN_EMERG      "<0>"   /* system is unusable                   */
  24 #define KERN_ALERT      "<1>"   /* action must be taken immediately     */
  25 #define KERN_CRIT       "<2>"   /* critical conditions                  */
  26 #define KERN_ERR        "<3>"   /* error conditions                     */
  27 #define KERN_WARNING    "<4>"   /* warning conditions                   */
  28 #define KERN_NOTICE     "<5>"   /* normal but significant condition     */
  29 #define KERN_INFO       "<6>"   /* informational                        */
  30 #define KERN_DEBUG      "<7>"   /* debug-level messages                 */
  31 
  32 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
  33 # define NORET_TYPE    __volatile__
  34 # define ATTRIB_NORET  /**/
  35 # define NORET_AND     /**/
  36 #else
  37 # define NORET_TYPE    /**/
  38 # define ATTRIB_NORET  __attribute__((noreturn))
  39 # define NORET_AND     noreturn,
  40 #endif
  41 
  42 extern void math_error(void);
  43 NORET_TYPE void panic(const char * fmt, ...)
  44         __attribute__ ((NORET_AND format (printf, 1, 2)));
  45 NORET_TYPE void do_exit(long error_code)
  46         ATTRIB_NORET;
  47 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
  48 extern int sprintf(char * buf, const char * fmt, ...);
  49 extern int vsprintf(char *buf, const char *, va_list);
  50 
  51 extern int session_of_pgrp(int pgrp);
  52 
  53 extern int kill_proc(int pid, int sig, int priv);
  54 extern int kill_pg(int pgrp, int sig, int priv);
  55 extern int kill_sl(int sess, int sig, int priv);
  56 
  57 asmlinkage int printk(const char * fmt, ...)
  58         __attribute__ ((format (printf, 1, 2)));
  59 
  60 /*
  61  * "suser()" checks against the effective user id, while "fsuser()"
  62  * is used for file permission checking and checks against the fsuid..
  63  */
  64 #define fsuser() (current->fsuid == 0)
  65 
  66 #endif /* __KERNEL__ */
  67 
  68 #define SI_LOAD_SHIFT   16
  69 struct sysinfo {
  70         long uptime;                    /* Seconds since boot */
  71         unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
  72         unsigned long totalram;         /* Total usable main memory size */
  73         unsigned long freeram;          /* Available memory size */
  74         unsigned long sharedram;        /* Amount of shared memory */
  75         unsigned long bufferram;        /* Memory used by buffers */
  76         unsigned long totalswap;        /* Total swap space size */
  77         unsigned long freeswap;         /* swap space still available */
  78         unsigned short procs;           /* Number of current processes */
  79         char _f[22];                    /* Pads structure to 64 bytes */
  80 };
  81 
  82 #endif

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