RTEMS CPU Kit with SuperCore  4.11.3
kernel.h
Go to the documentation of this file.
1 #ifndef __LINUX_KERNEL_H__
2 #define __LINUX_KERNEL_H__
3 
4 #include <rtems.h>
5 #include <stdlib.h>
6 #include <string.h>
7 
8 #include "kernel-rtems.h"
9 
10 #define jiffies ((unsigned long)rtems_clock_get_ticks_since_boot())
11 
12 #define ERR_PTR(err) ((void*)((intptr_t)(err)))
13 #define PTR_ERR(err) ((unsigned long)(err))
14 #define IS_ERR(err) ((unsigned long)err > (unsigned long)-1000L)
15 static inline void *ERR_CAST(const void *ptr)
16 {
17  return (void *) (uintptr_t) ptr;
18 }
19 
20 #define CURRENT_TIME cyg_timestamp()
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 #define KERN_CONT ""
31 
32 #ifndef pr_fmt
33 #define pr_fmt(fmt) fmt
34 #endif
35 
36 #define pr_emerg(fmt, ...) \
37  printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
38 #define pr_alert(fmt, ...) \
39  printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
40 #define pr_crit(fmt, ...) \
41  printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
42 #define pr_err(fmt, ...) \
43  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
44 #define pr_warning(fmt, ...) \
45  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
46 #define pr_warn pr_warning
47 #define pr_notice(fmt, ...) \
48  printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
49 #define pr_info(fmt, ...) \
50  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
51 #define pr_cont(fmt, ...) \
52  printk(KERN_CONT fmt, ##__VA_ARGS__)
53 
54 #ifdef DEBUG
55 #define pr_debug(fmt, ...) \
56  printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
57 #else
58 static inline int no_printk(const char *fmt, ...)
59 {
60  (void) fmt;
61  return 0;
62 }
63 #define pr_debug(fmt, ...) \
64  no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
65 #endif
66 
67 #define min(x,y) (x<y?x:y)
68 #define max(x,y) (x<y?y:x)
69 #define min_t(t, x,y) ((t)x<(t)y?(t)x:(t)y)
70 
71 #define capable(x) 0
72 
73 #define kmemdup(x, y, z) do_kmemdup(x, y)
74 
75 #define from_kuid(x, y) (y)
76 #define from_kgid(x, y) (y)
77 #define i_uid_read(x) ((x)->i_uid)
78 #define i_gid_read(x) ((x)->i_gid)
79 #define i_uid_write(x, y) do { (x)->i_uid = (y); } while (0)
80 #define i_gid_write(x, y) do { (x)->i_gid = (y); } while (0)
81 #define truncate_setsize(x, y) do { (x)->i_size = (y); } while (0)
82 
83 #endif /* __LINUX_KERNEL_H__ */
84 
85 
86 
87