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