diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-08-18 15:06:39 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2011-11-02 09:15:05 -0400 |
commit | 5c48b108ecbf6505d929e64d50dace13ac2bdf34 (patch) | |
tree | 016904f84fbe05aa301c5cdfe712d90f6bb828fe /arch/x86/um/stub_32.S | |
parent | 7bbe7204e93734fe79d8aac3e08a7cb4624b5004 (diff) |
um: take arch/um/sys-x86 to arch/x86/um
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86/um/stub_32.S')
-rw-r--r-- | arch/x86/um/stub_32.S | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/x86/um/stub_32.S b/arch/x86/um/stub_32.S new file mode 100644 index 000000000000..54a36ec20cb7 --- /dev/null +++ b/arch/x86/um/stub_32.S | |||
@@ -0,0 +1,51 @@ | |||
1 | #include "as-layout.h" | ||
2 | |||
3 | .globl syscall_stub | ||
4 | .section .__syscall_stub, "ax" | ||
5 | |||
6 | .globl batch_syscall_stub | ||
7 | batch_syscall_stub: | ||
8 | /* load pointer to first operation */ | ||
9 | mov $(STUB_DATA+8), %esp | ||
10 | |||
11 | again: | ||
12 | /* load length of additional data */ | ||
13 | mov 0x0(%esp), %eax | ||
14 | |||
15 | /* if(length == 0) : end of list */ | ||
16 | /* write possible 0 to header */ | ||
17 | mov %eax, STUB_DATA+4 | ||
18 | cmpl $0, %eax | ||
19 | jz done | ||
20 | |||
21 | /* save current pointer */ | ||
22 | mov %esp, STUB_DATA+4 | ||
23 | |||
24 | /* skip additional data */ | ||
25 | add %eax, %esp | ||
26 | |||
27 | /* load syscall-# */ | ||
28 | pop %eax | ||
29 | |||
30 | /* load syscall params */ | ||
31 | pop %ebx | ||
32 | pop %ecx | ||
33 | pop %edx | ||
34 | pop %esi | ||
35 | pop %edi | ||
36 | pop %ebp | ||
37 | |||
38 | /* execute syscall */ | ||
39 | int $0x80 | ||
40 | |||
41 | /* check return value */ | ||
42 | pop %ebx | ||
43 | cmp %ebx, %eax | ||
44 | je again | ||
45 | |||
46 | done: | ||
47 | /* save return value */ | ||
48 | mov %eax, STUB_DATA | ||
49 | |||
50 | /* stop */ | ||
51 | int3 | ||