This source file includes following definitions.
- get_user_byte
- get_user_word
- get_user_long
- get_user_dlong
- put_user_byte
- put_user_word
- put_user_long
- put_user_dlong
- get_fs
- get_ds
- set_fs
1
2
3
4
5
6
7
8
9
10
11 #ifndef __ASM_MIPS_SEGMENT_H
12 #define __ASM_MIPS_SEGMENT_H
13
14
15
16
17 #define KUSEG 0x00000000
18 #define KSEG0 0x80000000
19 #define KSEG1 0xa0000000
20 #define KSEG2 0xc0000000
21 #define KSEG3 0xe0000000
22
23
24
25
26 #define KSEGX(a) (a & 0xe0000000)
27
28 #ifndef __ASSEMBLY__
29
30
31
32
33 #define get_fs_byte(addr) get_user_byte((char *)(addr))
34 static inline unsigned char get_user_byte(const char *addr)
35 {
36 return *addr;
37 }
38
39 #define get_fs_word(addr) get_user_word((short *)(addr))
40 static inline unsigned short get_user_word(const short *addr)
41 {
42 return *addr;
43 }
44
45 #define get_fs_long(addr) get_user_long((int *)(addr))
46 static inline unsigned long get_user_long(const int *addr)
47 {
48 return *addr;
49 }
50
51 #define get_fs_dlong(addr) get_user_dlong((long long *)(addr))
52 static inline unsigned long get_user_dlong(const long long *addr)
53 {
54 return *addr;
55 }
56
57 #define put_fs_byte(x,addr) put_user_byte((x),(char *)(addr))
58 static inline void put_user_byte(char val,char *addr)
59 {
60 *addr = val;
61 }
62
63 #define put_fs_word(x,addr) put_user_word((x),(short *)(addr))
64 static inline void put_user_word(short val,short * addr)
65 {
66 *addr = val;
67 }
68
69 #define put_fs_long(x,addr) put_user_long((x),(int *)(addr))
70 static inline void put_user_long(unsigned long val,int * addr)
71 {
72 *addr = val;
73 }
74
75 #define put_fs_dlong(x,addr) put_user_dlong((x),(int *)(addr))
76 static inline void put_user_dlong(unsigned long val,long long * addr)
77 {
78 *addr = val;
79 }
80
81 #define memcpy_fromfs(to, from, n) memcpy((to),(from),(n))
82
83 #define memcpy_tofs(to, from, n) memcpy((to),(from),(n))
84
85
86
87
88
89
90
91
92 #define KERNEL_DS 0
93 #define USER_DS 1
94
95 static inline unsigned long get_fs(void)
96 {
97 return 0;
98 }
99
100 static inline unsigned long get_ds(void)
101 {
102 return 0;
103 }
104
105 static inline void set_fs(unsigned long val)
106 {
107 }
108
109 #endif
110
111 #endif