diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-08-17 13:48:37 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-10-23 01:55:19 -0400 |
commit | 8569c9140bd41089f9b6be8837ca421102714a90 (patch) | |
tree | cd289b322b215fe2ca2530aa320febfd99388d7f /arch/um/include/sysdep-i386/stub.h | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
x86, um: take arch/um/include/* out of the way
We can't just plop asm/* into it - userland helpers are built with it
in search path and seeing asm/* show up there suddenly would be a bad
idea.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/um/include/sysdep-i386/stub.h')
-rw-r--r-- | arch/um/include/sysdep-i386/stub.h | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/arch/um/include/sysdep-i386/stub.h b/arch/um/include/sysdep-i386/stub.h deleted file mode 100644 index 8c097b87fca7..000000000000 --- a/arch/um/include/sysdep-i386/stub.h +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SYSDEP_STUB_H | ||
7 | #define __SYSDEP_STUB_H | ||
8 | |||
9 | #include <sys/mman.h> | ||
10 | #include <asm/ptrace.h> | ||
11 | #include <asm/unistd.h> | ||
12 | #include "as-layout.h" | ||
13 | #include "stub-data.h" | ||
14 | #include "kern_constants.h" | ||
15 | #include "uml-config.h" | ||
16 | |||
17 | extern void stub_segv_handler(int sig); | ||
18 | extern void stub_clone_handler(void); | ||
19 | |||
20 | #define STUB_SYSCALL_RET EAX | ||
21 | #define STUB_MMAP_NR __NR_mmap2 | ||
22 | #define MMAP_OFFSET(o) ((o) >> UM_KERN_PAGE_SHIFT) | ||
23 | |||
24 | static inline long stub_syscall0(long syscall) | ||
25 | { | ||
26 | long ret; | ||
27 | |||
28 | __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall)); | ||
29 | |||
30 | return ret; | ||
31 | } | ||
32 | |||
33 | static inline long stub_syscall1(long syscall, long arg1) | ||
34 | { | ||
35 | long ret; | ||
36 | |||
37 | __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1)); | ||
38 | |||
39 | return ret; | ||
40 | } | ||
41 | |||
42 | static inline long stub_syscall2(long syscall, long arg1, long arg2) | ||
43 | { | ||
44 | long ret; | ||
45 | |||
46 | __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1), | ||
47 | "c" (arg2)); | ||
48 | |||
49 | return ret; | ||
50 | } | ||
51 | |||
52 | static inline long stub_syscall3(long syscall, long arg1, long arg2, long arg3) | ||
53 | { | ||
54 | long ret; | ||
55 | |||
56 | __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1), | ||
57 | "c" (arg2), "d" (arg3)); | ||
58 | |||
59 | return ret; | ||
60 | } | ||
61 | |||
62 | static inline long stub_syscall4(long syscall, long arg1, long arg2, long arg3, | ||
63 | long arg4) | ||
64 | { | ||
65 | long ret; | ||
66 | |||
67 | __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1), | ||
68 | "c" (arg2), "d" (arg3), "S" (arg4)); | ||
69 | |||
70 | return ret; | ||
71 | } | ||
72 | |||
73 | static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3, | ||
74 | long arg4, long arg5) | ||
75 | { | ||
76 | long ret; | ||
77 | |||
78 | __asm__ volatile ("int $0x80" : "=a" (ret) : "0" (syscall), "b" (arg1), | ||
79 | "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)); | ||
80 | |||
81 | return ret; | ||
82 | } | ||
83 | |||
84 | static inline void trap_myself(void) | ||
85 | { | ||
86 | __asm("int3"); | ||
87 | } | ||
88 | |||
89 | static inline void remap_stack(int fd, unsigned long offset) | ||
90 | { | ||
91 | __asm__ volatile ("movl %%eax,%%ebp ; movl %0,%%eax ; int $0x80 ;" | ||
92 | "movl %7, %%ebx ; movl %%eax, (%%ebx)" | ||
93 | : : "g" (STUB_MMAP_NR), "b" (STUB_DATA), | ||
94 | "c" (UM_KERN_PAGE_SIZE), | ||
95 | "d" (PROT_READ | PROT_WRITE), | ||
96 | "S" (MAP_FIXED | MAP_SHARED), "D" (fd), | ||
97 | "a" (offset), | ||
98 | "i" (&((struct stub_data *) STUB_DATA)->err) | ||
99 | : "memory"); | ||
100 | } | ||
101 | |||
102 | #endif | ||