Version:  2.0.40 2.2.26 2.4.37 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10

Linux/include/linux/kernel.h

  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 # define NORET_TYPE    /**/
 33 # define ATTRIB_NORET  __attribute__((noreturn))
 34 # define NORET_AND     noreturn,
 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 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
 42 extern int sprintf(char *buf, const char *fmt, ...)
 43         __attribute__ ((format (printf, 2, 3)));
 44 extern int vsprintf(char *buf, const char *, va_list)
 45         __attribute__ ((format (printf, 2, 0)));
 46 extern int _vsnprintf(char *buf, int n, const char *, va_list)
 47         __attribute__ ((format (printf, 3, 0)));
 48 
 49 extern int session_of_pgrp(int pgrp);
 50 
 51 extern int kill_proc(int pid, int sig, int priv);
 52 extern int kill_pg(int pgrp, int sig, int priv);
 53 extern int kill_sl(int sess, int sig, int priv);
 54 
 55 asmlinkage int printk(const char * fmt, ...)
 56         __attribute__ ((format (printf, 1, 2)));
 57 
 58 #if DEBUG
 59 #define pr_debug(fmt,arg...) \
 60         printk(KERN_DEBUG fmt,##arg)
 61 #else
 62 #define pr_debug(fmt,arg...) \
 63         do { } while (0)
 64 #endif
 65 
 66 #define pr_info(fmt,arg...) \
 67         printk(KERN_INFO fmt,##arg)
 68 
 69 /*
 70  * "suser()" checks against the effective user id, while "fsuser()"
 71  * is used for file permission checking and checks against the fsuid..
 72  */
 73 #define fsuser() (current->fsuid == 0)
 74 
 75 /*
 76  *      Display an IP address in readable format. 
 77  */
 78   
 79 #define NIPQUAD(addr) \
 80         (((addr) >> 0)  & 0xff), \
 81         (((addr) >> 8)  & 0xff), \
 82         (((addr) >> 16) & 0xff), \
 83         (((addr) >> 24) & 0xff)
 84 
 85 #endif /* __KERNEL__ */
 86 
 87 #define SI_LOAD_SHIFT   16
 88 struct sysinfo {
 89         long uptime;                    /* Seconds since boot */
 90         unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
 91         unsigned long totalram;         /* Total usable main memory size */
 92         unsigned long freeram;          /* Available memory size */
 93         unsigned long sharedram;        /* Amount of shared memory */
 94         unsigned long bufferram;        /* Memory used by buffers */
 95         unsigned long totalswap;        /* Total swap space size */
 96         unsigned long freeswap;         /* swap space still available */
 97         unsigned short procs;           /* Number of current processes */
 98         char _f[22];                    /* Pads structure to 64 bytes */
 99 };
100 
101 #endif
102 

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us