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/linkage.h>
  11 
  12 #define INT_MAX         ((int)(~0U>>1))
  13 #define UINT_MAX        (~0U)
  14 #define LONG_MAX        ((long)(~0UL>>1))
  15 #define ULONG_MAX       (~0UL)
  16 
  17 #define KERN_EMERG      "<0>"   /* system is unusable                   */
  18 #define KERN_ALERT      "<1>"   /* action must be taken immediately     */
  19 #define KERN_CRIT       "<2>"   /* critical conditions                  */
  20 #define KERN_ERR        "<3>"   /* error conditions                     */
  21 #define KERN_WARNING    "<4>"   /* warning conditions                   */
  22 #define KERN_NOTICE     "<5>"   /* normal but significant condition     */
  23 #define KERN_INFO       "<6>"   /* informational                        */
  24 #define KERN_DEBUG      "<7>"   /* debug-level messages                 */
  25 
  26 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
  27 # define NORET_TYPE    __volatile__
  28 # define ATTRIB_NORET  /**/
  29 # define NORET_AND     /**/
  30 #else
  31 # define NORET_TYPE    /**/
  32 # define ATTRIB_NORET  __attribute__((noreturn))
  33 # define NORET_AND     noreturn,
  34 #endif
  35 
  36 extern void math_error(void);
  37 NORET_TYPE void panic(const char * fmt, ...)
  38         __attribute__ ((NORET_AND format (printf, 1, 2)));
  39 NORET_TYPE void do_exit(long error_code)
  40         ATTRIB_NORET;
  41 unsigned long simple_strtoul(const char *,char **,unsigned int);
  42 int sprintf(char * buf, const char * fmt, ...);
  43 
  44 int session_of_pgrp(int pgrp);
  45 
  46 int kill_proc(int pid, int sig, int priv);
  47 int kill_pg(int pgrp, int sig, int priv);
  48 int kill_sl(int sess, int sig, int priv);
  49 
  50 asmlinkage int printk(const char * fmt, ...)
  51         __attribute__ ((format (printf, 1, 2)));
  52 
  53 /*
  54  * This is defined as a macro, but at some point this might become a
  55  * real subroutine that sets a flag if it returns true (to do
  56  * BSD-style accounting where the process is flagged if it uses root
  57  * privs).  The implication of this is that you should do normal
  58  * permissions checks first, and check suser() last.
  59  */
  60 #define suser() (current->euid == 0)
  61 
  62 #endif /* __KERNEL__ */
  63 
  64 #define SI_LOAD_SHIFT   16
  65 struct sysinfo {
  66         long uptime;                    /* Seconds since boot */
  67         unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
  68         unsigned long totalram;         /* Total usable main memory size */
  69         unsigned long freeram;          /* Available memory size */
  70         unsigned long sharedram;        /* Amount of shared memory */
  71         unsigned long bufferram;        /* Memory used by buffers */
  72         unsigned long totalswap;        /* Total swap space size */
  73         unsigned long freeswap;         /* swap space still available */
  74         unsigned short procs;           /* Number of current processes */
  75         char _f[22];                    /* Pads structure to 64 bytes */
  76 };
  77 
  78 #endif

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