1
2#include <as-layout.h>
3
4.section .__syscall_stub, "ax"
5
6 .globl batch_syscall_stub
7batch_syscall_stub:
8
9 mov %esp, %ecx
10
11 add $8, %esp
12again:
13
14 mov 0x0(%esp), %eax
15
16
17
18 mov %eax, 0x4(%ecx)
19 cmpl $0, %eax
20 jz done
21
22
23 mov %esp, 0x4(%ecx)
24
25
26 add %eax, %esp
27
28
29 pop %eax
30
31
32 pop %ebx
33 pop %ecx
34 pop %edx
35 pop %esi
36 pop %edi
37 pop %ebp
38
39
40 int $0x80
41
42
43 mov %esp, %ecx
44 andl $(~UM_KERN_PAGE_SIZE) + 1, %ecx
45
46
47 pop %ebx
48 cmp %ebx, %eax
49 je again
50
51done:
52
53 mov %eax, (%ecx)
54
55
56 int3
57