1 #ifndef _LINUX_KERNEL_H
2 #define _LINUX_KERNEL_H
3
4
5
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 VERIFY_READ 0
18 #define VERIFY_WRITE 1
19
20 int verify_area(int type, void * addr, unsigned long count);
21
22 #define KERN_EMERG "<0>"
23 #define KERN_ALERT "<1>"
24 #define KERN_CRIT "<2>"
25 #define KERN_ERR "<3>"
26 #define KERN_WARNING "<4>"
27 #define KERN_NOTICE "<5>"
28 #define KERN_INFO "<6>"
29 #define KERN_DEBUG "<7>"
30
31 #if __GNUC__ < 2 || __GNUC_MINOR__ < 5
32 # define NORET_TYPE __volatile__
33 # define ATTRIB_NORET
34 # define NORET_AND
35 #else
36 # define NORET_TYPE
37 # define ATTRIB_NORET __attribute__((noreturn))
38 # define NORET_AND noreturn,
39 #endif
40
41 extern void math_error(void);
42 NORET_TYPE void panic(const char * fmt, ...)
43 __attribute__ ((NORET_AND format (printf, 1, 2)));
44 NORET_TYPE void do_exit(long error_code)
45 ATTRIB_NORET;
46 unsigned long simple_strtoul(const char *,char **,unsigned int);
47 int sprintf(char * buf, const char * fmt, ...);
48
49 int session_of_pgrp(int pgrp);
50
51 int kill_proc(int pid, int sig, int priv);
52 int kill_pg(int pgrp, int sig, int priv);
53 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
59
60
61
62
63
64
65 #define suser() (current->euid == 0)
66
67 #endif
68
69 #define SI_LOAD_SHIFT 16
70 struct sysinfo {
71 long uptime;
72 unsigned long loads[3];
73 unsigned long totalram;
74 unsigned long freeram;
75 unsigned long sharedram;
76 unsigned long bufferram;
77 unsigned long totalswap;
78 unsigned long freeswap;
79 unsigned short procs;
80 char _f[22];
81 };
82
83 #endif