有些来自 linux-2.6.25,不同版本变化不太大,
1. linkage.h
#define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
set_thread_flag(TIF_IRET);
#define asmlinkage_protect(n, ret, args...) \
__asmlinkage_protect##n(ret, ##args)
#define set_thread_flag(flag) \
set_ti_thread_flag(current_thread_info(), flag)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2.uaccess_32.h
-
28 #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFFUL)
-
29 #define USER_DS MAKE_MM_SEG(PAGE_OFFSET)
-
30
-
31 #define get_ds() (KERNEL_DS)
-
32 #define get_fs() (current_thread_info()->addr_limit)
-
33 #define set_fs(x) (current_thread_info()->addr_limit = (x))
-
-
#define strlen_user(str) strnlen_user(str, LONG_MAX)
-
#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))
-
get_user()
-
put_user()
-
-
-
#define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0)
阅读(599) | 评论(0) | 转发(0) |