|
RTEMS
5.1
|
1 #ifndef __LINUX_KERNEL_H__ 2 #define __LINUX_KERNEL_H__ 7 #include "kernel-rtems.h" 9 #define jiffies ((unsigned long)rtems_clock_get_ticks_since_boot()) 11 #define ERR_PTR(err) ((void*)((intptr_t)(err))) 12 #define PTR_ERR(err) ((unsigned long)(err)) 13 #define IS_ERR(err) ((unsigned long)err > (unsigned long)-1000L) 14 static inline void *ERR_CAST(
const void *ptr)
16 return (
void *) (uintptr_t) ptr;
19 #define CURRENT_TIME cyg_timestamp() 21 #define KERN_EMERG "<0>" 22 #define KERN_ALERT "<1>" 23 #define KERN_CRIT "<2>" 24 #define KERN_ERR "<3>" 25 #define KERN_WARNING "<4>" 26 #define KERN_NOTICE "<5>" 27 #define KERN_INFO "<6>" 28 #define KERN_DEBUG "<7>" 32 #define pr_fmt(fmt) fmt 35 #define pr_emerg(fmt, ...) \ 36 printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) 37 #define pr_alert(fmt, ...) \ 38 printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) 39 #define pr_crit(fmt, ...) \ 40 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 41 #define pr_err(fmt, ...) \ 42 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 43 #define pr_warning(fmt, ...) \ 44 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 45 #define pr_warn pr_warning 46 #define pr_notice(fmt, ...) \ 47 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 48 #define pr_info(fmt, ...) \ 49 printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 50 #define pr_cont(fmt, ...) \ 51 printk(KERN_CONT fmt, ##__VA_ARGS__) 54 #define pr_debug(fmt, ...) \ 55 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 57 static inline int no_printk(
const char *fmt, ...)
62 #define pr_debug(fmt, ...) \ 63 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 66 #define min(x,y) (x<y?x:y) 67 #define max(x,y) (x<y?y:x) 68 #define min_t(t, x,y) ((t)x<(t)y?(t)x:(t)y) 72 #define kmemdup(x, y, z) do_kmemdup(x, y) 74 #define from_kuid(x, y) (y) 75 #define from_kgid(x, y) (y) 76 #define i_uid_read(x) ((x)->i_uid) 77 #define i_gid_read(x) ((x)->i_gid) 78 #define i_uid_write(x, y) do { (x)->i_uid = (y); } while (0) 79 #define i_gid_write(x, y) do { (x)->i_gid = (y); } while (0) 80 #define truncate_setsize(x, y) do { (x)->i_size = (y); } while (0)