diff options
Diffstat (limited to 'arch/um/sys-x86_64/stub.S')
-rw-r--r-- | arch/um/sys-x86_64/stub.S | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/um/sys-x86_64/stub.S b/arch/um/sys-x86_64/stub.S index 31c14925716b..03c279735784 100644 --- a/arch/um/sys-x86_64/stub.S +++ b/arch/um/sys-x86_64/stub.S | |||
@@ -13,3 +13,54 @@ syscall_stub: | |||
13 | or %rcx, %rbx | 13 | or %rcx, %rbx |
14 | movq %rax, (%rbx) | 14 | movq %rax, (%rbx) |
15 | int3 | 15 | int3 |
16 | |||
17 | .globl batch_syscall_stub | ||
18 | batch_syscall_stub: | ||
19 | mov $(UML_CONFIG_STUB_DATA >> 32), %rbx | ||
20 | sal $32, %rbx | ||
21 | mov $(UML_CONFIG_STUB_DATA & 0xffffffff), %rax | ||
22 | or %rax, %rbx | ||
23 | /* load pointer to first operation */ | ||
24 | mov %rbx, %rsp | ||
25 | add $0x10, %rsp | ||
26 | again: | ||
27 | /* load length of additional data */ | ||
28 | mov 0x0(%rsp), %rax | ||
29 | |||
30 | /* if(length == 0) : end of list */ | ||
31 | /* write possible 0 to header */ | ||
32 | mov %rax, 8(%rbx) | ||
33 | cmp $0, %rax | ||
34 | jz done | ||
35 | |||
36 | /* save current pointer */ | ||
37 | mov %rsp, 8(%rbx) | ||
38 | |||
39 | /* skip additional data */ | ||
40 | add %rax, %rsp | ||
41 | |||
42 | /* load syscall-# */ | ||
43 | pop %rax | ||
44 | |||
45 | /* load syscall params */ | ||
46 | pop %rdi | ||
47 | pop %rsi | ||
48 | pop %rdx | ||
49 | pop %r10 | ||
50 | pop %r8 | ||
51 | pop %r9 | ||
52 | |||
53 | /* execute syscall */ | ||
54 | syscall | ||
55 | |||
56 | /* check return value */ | ||
57 | pop %rcx | ||
58 | cmp %rcx, %rax | ||
59 | je again | ||
60 | |||
61 | done: | ||
62 | /* save return value */ | ||
63 | mov %rax, (%rbx) | ||
64 | |||
65 | /* stop */ | ||
66 | int3 | ||