This source file includes following definitions.
- get_user_byte
- get_user_word
- get_user_long
- get_user_quad
- put_user_byte
- put_user_word
- put_user_long
- put_user_quad
- get_fs
- get_ds
- set_fs
1 #ifndef _ASM_SEGMENT_H
2 #define _ASM_SEGMENT_H
3
4 #define KERNEL_CS 0x0
5 #define KERNEL_DS 0x0
6
7 #define USER_CS 0x1
8 #define USER_DS 0x1
9
10 #include <linux/string.h>
11
12 static inline unsigned char get_user_byte(const char * addr)
13 {
14 return *addr;
15 }
16
17 #define get_fs_byte(addr) get_user_byte((char *)(addr))
18
19 static inline unsigned short get_user_word(const short *addr)
20 {
21 return *addr;
22 }
23
24 #define get_fs_word(addr) get_user_word((short *)(addr))
25
26 static inline unsigned long get_user_long(const int *addr)
27 {
28 return *addr;
29 }
30
31 #define get_fs_long(addr) get_user_long((int *)(addr))
32
33 static inline unsigned long get_user_quad(const long *addr)
34 {
35 return *addr;
36 }
37
38 #define get_fs_quad(addr) get_user_quad((long *)(addr))
39
40 static inline void put_user_byte(char val,char *addr)
41 {
42 *addr = val;
43 }
44
45 #define put_fs_byte(x,addr) put_user_byte((x),(char *)(addr))
46
47 static inline void put_user_word(short val,short * addr)
48 {
49 *addr = val;
50 }
51
52 #define put_fs_word(x,addr) put_user_word((x),(short *)(addr))
53
54 static inline void put_user_long(unsigned long val,int * addr)
55 {
56 *addr = val;
57 }
58
59 #define put_fs_long(x,addr) put_user_long((x),(int *)(addr))
60
61 static inline void put_user_quad(unsigned long val,long * addr)
62 {
63 *addr = val;
64 }
65
66 #define put_fs_quad(x,addr) put_user_quad((x),(long *)(addr))
67
68 #define memcpy_fromfs(to, from, n) memcpy((to),(from),(n))
69
70 #define memcpy_tofs(to, from, n) memcpy((to),(from),(n))
71
72 static inline unsigned long get_fs(void)
73 {
74 return 0;
75 }
76
77 static inline unsigned long get_ds(void)
78 {
79 return 0;
80 }
81
82 static inline void set_fs(unsigned long val)
83 {
84 }
85
86 #endif