OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [linux/] [kernel.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#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
#define STACK_UNTOUCHED_MAGIC   0xfeef1ef0
23
 
24
#define KERN_EMERG      "<0>"    /* system is unusable                   */
25
#define KERN_ALERT      "<1>"   /* action must be taken immediately     */
26
#define KERN_CRIT       "<2>"   /* critical conditions                  */
27
#define KERN_ERR        "<3>"   /* error conditions                     */
28
#define KERN_WARNING    "<4>"   /* warning conditions                   */
29
#define KERN_NOTICE     "<5>"   /* normal but significant condition     */
30
#define KERN_INFO       "<6>"   /* informational                        */
31
#define KERN_DEBUG      "<7>"   /* debug-level messages                 */
32
 
33
# define NORET_TYPE    /**/
34
# define ATTRIB_NORET  __attribute__((noreturn))
35
# define NORET_AND     noreturn,
36
 
37
extern void math_error(void);
38
NORET_TYPE void panic(const char * fmt, ...)
39
        __attribute__ ((NORET_AND format (printf, 1, 2)));
40
NORET_TYPE void do_exit(long error_code)
41
        ATTRIB_NORET;
42
extern unsigned long simple_strtoul(const char *,char **,unsigned int);
43
extern int sprintf(char * buf, const char * fmt, ...);
44
extern int vsprintf(char *buf, const char *, va_list);
45
 
46
extern int session_of_pgrp(int pgrp);
47
 
48
extern int kill_proc(int pid, int sig, int priv);
49
extern int kill_pg(int pgrp, int sig, int priv);
50
extern int kill_sl(int sess, int sig, int priv);
51
 
52
asmlinkage int printk(const char * fmt, ...)
53
        __attribute__ ((format (printf, 1, 2)));
54
 
55
#if DEBUG
56
#define pr_debug(fmt,arg...) \
57
        printk(KERN_DEBUG fmt,##arg)
58
#else
59
#define pr_debug(fmt,arg...) \
60
        do { } while (0)
61
#endif
62
 
63
#define pr_info(fmt,arg...) \
64
        printk(KERN_INFO fmt,##arg)
65
 
66
/*
67
 * "suser()" checks against the effective user id, while "fsuser()"
68
 * is used for file permission checking and checks against the fsuid..
69
 */
70
#define fsuser() (current->fsuid == 0)
71
 
72
/*
73
 *      Display an IP address in readable format.
74
 */
75
 
76
#define NIPQUAD(addr) \
77
        (((addr) >> 0)  & 0xff), \
78
        (((addr) >> 8)  & 0xff), \
79
        (((addr) >> 16) & 0xff), \
80
        (((addr) >> 24) & 0xff)
81
 
82
#endif /* __KERNEL__ */
83
 
84
#define SI_LOAD_SHIFT   16
85
struct sysinfo {
86
        long uptime;                    /* Seconds since boot */
87
        unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
88
        unsigned long totalram;         /* Total usable main memory size */
89
        unsigned long freeram;          /* Available memory size */
90
        unsigned long sharedram;        /* Amount of shared memory */
91
        unsigned long bufferram;        /* Memory used by buffers */
92
        unsigned long totalswap;        /* Total swap space size */
93
        unsigned long freeswap;         /* swap space still available */
94
        unsigned short procs;           /* Number of current processes */
95
        char _f[22];                    /* Pads structure to 64 bytes */
96
};
97
 
98
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.