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