Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
s390
include
asm
compat.h
Go to the documentation of this file.
1
#ifndef _ASM_S390X_COMPAT_H
2
#define _ASM_S390X_COMPAT_H
3
/*
4
* Architecture specific compatibility types
5
*/
6
#include <linux/types.h>
7
#include <linux/sched.h>
8
#include <
linux/thread_info.h
>
9
10
#define PSW32_MASK_PER 0x40000000UL
11
#define PSW32_MASK_DAT 0x04000000UL
12
#define PSW32_MASK_IO 0x02000000UL
13
#define PSW32_MASK_EXT 0x01000000UL
14
#define PSW32_MASK_KEY 0x00F00000UL
15
#define PSW32_MASK_BASE 0x00080000UL
/* Always one */
16
#define PSW32_MASK_MCHECK 0x00040000UL
17
#define PSW32_MASK_WAIT 0x00020000UL
18
#define PSW32_MASK_PSTATE 0x00010000UL
19
#define PSW32_MASK_ASC 0x0000C000UL
20
#define PSW32_MASK_CC 0x00003000UL
21
#define PSW32_MASK_PM 0x00000f00UL
22
23
#define PSW32_MASK_USER 0x0000FF00UL
24
25
#define PSW32_ADDR_AMODE 0x80000000UL
26
#define PSW32_ADDR_INSN 0x7FFFFFFFUL
27
28
#define PSW32_DEFAULT_KEY (((u32) PAGE_DEFAULT_ACC) << 20)
29
30
#define PSW32_ASC_PRIMARY 0x00000000UL
31
#define PSW32_ASC_ACCREG 0x00004000UL
32
#define PSW32_ASC_SECONDARY 0x00008000UL
33
#define PSW32_ASC_HOME 0x0000C000UL
34
35
extern
u32
psw32_user_bits
;
36
37
#define COMPAT_USER_HZ 100
38
#define COMPAT_UTS_MACHINE "s390\0\0\0\0"
39
40
typedef
u32
compat_size_t
;
41
typedef
s32
compat_ssize_t
;
42
typedef
s32
compat_time_t
;
43
typedef
s32
compat_clock_t
;
44
typedef
s32
compat_pid_t
;
45
typedef
u16
__compat_uid_t
;
46
typedef
u16
__compat_gid_t
;
47
typedef
u32
__compat_uid32_t
;
48
typedef
u32
__compat_gid32_t
;
49
typedef
u16
compat_mode_t
;
50
typedef
u32
compat_ino_t
;
51
typedef
u16
compat_dev_t
;
52
typedef
s32
compat_off_t
;
53
typedef
s64
compat_loff_t
;
54
typedef
u16
compat_nlink_t
;
55
typedef
u16
compat_ipc_pid_t
;
56
typedef
s32
compat_daddr_t
;
57
typedef
u32
compat_caddr_t
;
58
typedef
__kernel_fsid_t
compat_fsid_t
;
59
typedef
s32
compat_key_t
;
60
typedef
s32
compat_timer_t
;
61
62
typedef
s32
compat_int_t
;
63
typedef
s32
compat_long_t
;
64
typedef
s64
compat_s64
;
65
typedef
u32
compat_uint_t
;
66
typedef
u32
compat_ulong_t
;
67
typedef
u64
compat_u64
;
68
typedef
u32
compat_uptr_t
;
69
70
struct
compat_timespec
{
71
compat_time_t
tv_sec
;
72
s32
tv_nsec
;
73
};
74
75
struct
compat_timeval
{
76
compat_time_t
tv_sec
;
77
s32
tv_usec
;
78
};
79
80
struct
compat_stat
{
81
compat_dev_t
st_dev
;
82
u16
__pad1
;
83
compat_ino_t
st_ino
;
84
compat_mode_t
st_mode
;
85
compat_nlink_t
st_nlink
;
86
__compat_uid_t
st_uid
;
87
__compat_gid_t
st_gid
;
88
compat_dev_t
st_rdev
;
89
u16
__pad2
;
90
u32
st_size
;
91
u32
st_blksize
;
92
u32
st_blocks
;
93
u32
st_atime
;
94
u32
st_atime_nsec
;
95
u32
st_mtime
;
96
u32
st_mtime_nsec
;
97
u32
st_ctime
;
98
u32
st_ctime_nsec
;
99
u32
__unused4
;
100
u32
__unused5
;
101
};
102
103
struct
compat_flock
{
104
short
l_type
;
105
short
l_whence
;
106
compat_off_t
l_start
;
107
compat_off_t
l_len
;
108
compat_pid_t
l_pid
;
109
};
110
111
#define F_GETLK64 12
112
#define F_SETLK64 13
113
#define F_SETLKW64 14
114
115
struct
compat_flock64
{
116
short
l_type
;
117
short
l_whence
;
118
compat_loff_t
l_start
;
119
compat_loff_t
l_len
;
120
compat_pid_t
l_pid
;
121
};
122
123
struct
compat_statfs
{
124
s32
f_type
;
125
s32
f_bsize
;
126
s32
f_blocks
;
127
s32
f_bfree
;
128
s32
f_bavail
;
129
s32
f_files
;
130
s32
f_ffree
;
131
compat_fsid_t
f_fsid
;
132
s32
f_namelen
;
133
s32
f_frsize
;
134
s32
f_flags
;
135
s32
f_spare
[5];
136
};
137
138
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
139
#define COMPAT_RLIM_INFINITY 0xffffffff
140
141
typedef
u32
compat_old_sigset_t
;
/* at least 32 bits */
142
143
#define _COMPAT_NSIG 64
144
#define _COMPAT_NSIG_BPW 32
145
146
typedef
u32
compat_sigset_word
;
147
148
typedef
union
compat_sigval
{
149
compat_int_t
sival_int
;
150
compat_uptr_t
sival_ptr
;
151
}
compat_sigval_t
;
152
153
typedef
struct
compat_siginfo
{
154
int
si_signo
;
155
int
si_errno
;
156
int
si_code
;
157
158
union
{
159
int
_pad
[128/
sizeof
(
int
) - 3];
160
161
/* kill() */
162
struct
{
163
pid_t
_pid
;
/* sender's pid */
164
uid_t
_uid
;
/* sender's uid */
165
}
_kill
;
166
167
/* POSIX.1b timers */
168
struct
{
169
compat_timer_t
_tid
;
/* timer id */
170
int
_overrun
;
/* overrun count */
171
compat_sigval_t
_sigval
;
/* same as below */
172
int
_sys_private
;
/* not to be passed to user */
173
}
_timer
;
174
175
/* POSIX.1b signals */
176
struct
{
177
pid_t
_pid
;
/* sender's pid */
178
uid_t
_uid
;
/* sender's uid */
179
compat_sigval_t
_sigval
;
180
}
_rt
;
181
182
/* SIGCHLD */
183
struct
{
184
pid_t
_pid
;
/* which child */
185
uid_t
_uid
;
/* sender's uid */
186
int
_status
;
/* exit code */
187
compat_clock_t
_utime
;
188
compat_clock_t
_stime
;
189
}
_sigchld
;
190
191
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
192
struct
{
193
__u32
_addr
;
/* faulting insn/memory ref. - pointer */
194
}
_sigfault
;
195
196
/* SIGPOLL */
197
struct
{
198
int
_band
;
/* POLL_IN, POLL_OUT, POLL_MSG */
199
int
_fd
;
200
}
_sigpoll
;
201
}
_sifields
;
202
}
compat_siginfo_t
;
203
204
/*
205
* How these fields are to be accessed.
206
*/
207
#define si_pid _sifields._kill._pid
208
#define si_uid _sifields._kill._uid
209
#define si_status _sifields._sigchld._status
210
#define si_utime _sifields._sigchld._utime
211
#define si_stime _sifields._sigchld._stime
212
#define si_value _sifields._rt._sigval
213
#define si_int _sifields._rt._sigval.sival_int
214
#define si_ptr _sifields._rt._sigval.sival_ptr
215
#define si_addr _sifields._sigfault._addr
216
#define si_band _sifields._sigpoll._band
217
#define si_fd _sifields._sigpoll._fd
218
#define si_tid _sifields._timer._tid
219
#define si_overrun _sifields._timer._overrun
220
221
#define COMPAT_OFF_T_MAX 0x7fffffff
222
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
223
224
/*
225
* A pointer passed in from user mode. This should not
226
* be used for syscall parameters, just declare them
227
* as pointers because the syscall entry code will have
228
* appropriately converted them already.
229
*/
230
231
static
inline
void
__user
*compat_ptr(
compat_uptr_t
uptr)
232
{
233
return
(
void
__user
*)(
unsigned
long
)(uptr & 0x7fffffffUL);
234
}
235
236
static
inline
compat_uptr_t
ptr_to_compat(
void
__user *uptr)
237
{
238
return
(
u32
)(
unsigned
long
)uptr;
239
}
240
241
#ifdef CONFIG_COMPAT
242
243
static
inline
int
is_compat_task
(
void
)
244
{
245
return
is_32bit_task
();
246
}
247
248
#endif
249
250
static
inline
void
__user
*arch_compat_alloc_user_space(
long
len)
251
{
252
unsigned
long
stack
;
253
254
stack =
KSTK_ESP
(
current
);
255
if
(
is_compat_task
())
256
stack &= 0x7fffffff
UL
;
257
return
(
void
__user *) (stack - len);
258
}
259
260
struct
compat_ipc64_perm
{
261
compat_key_t
key
;
262
__compat_uid32_t
uid
;
263
__compat_gid32_t
gid
;
264
__compat_uid32_t
cuid
;
265
__compat_gid32_t
cgid
;
266
compat_mode_t
mode
;
267
unsigned
short
__pad1
;
268
unsigned
short
seq
;
269
unsigned
short
__pad2
;
270
unsigned
int
__unused1
;
271
unsigned
int
__unused2
;
272
};
273
274
struct
compat_semid64_ds
{
275
struct
compat_ipc64_perm
sem_perm;
276
compat_time_t
sem_otime
;
277
compat_ulong_t
__pad1
;
278
compat_time_t
sem_ctime
;
279
compat_ulong_t
__pad2
;
280
compat_ulong_t
sem_nsems
;
281
compat_ulong_t
__unused1
;
282
compat_ulong_t
__unused2
;
283
};
284
285
struct
compat_msqid64_ds
{
286
struct
compat_ipc64_perm
msg_perm;
287
compat_time_t
msg_stime
;
288
compat_ulong_t
__pad1
;
289
compat_time_t
msg_rtime
;
290
compat_ulong_t
__pad2
;
291
compat_time_t
msg_ctime
;
292
compat_ulong_t
__pad3
;
293
compat_ulong_t
msg_cbytes
;
294
compat_ulong_t
msg_qnum
;
295
compat_ulong_t
msg_qbytes
;
296
compat_pid_t
msg_lspid
;
297
compat_pid_t
msg_lrpid
;
298
compat_ulong_t
__unused1
;
299
compat_ulong_t
__unused2
;
300
};
301
302
struct
compat_shmid64_ds
{
303
struct
compat_ipc64_perm
shm_perm;
304
compat_size_t
shm_segsz
;
305
compat_time_t
shm_atime
;
306
compat_ulong_t
__pad1
;
307
compat_time_t
shm_dtime
;
308
compat_ulong_t
__pad2
;
309
compat_time_t
shm_ctime
;
310
compat_ulong_t
__pad3
;
311
compat_pid_t
shm_cpid
;
312
compat_pid_t
shm_lpid
;
313
compat_ulong_t
shm_nattch
;
314
compat_ulong_t
__unused1
;
315
compat_ulong_t
__unused2
;
316
};
317
#endif
/* _ASM_S390X_COMPAT_H */
Generated on Thu Jan 10 2013 13:03:33 for Linux Kernel by
1.8.2