License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6/btrfs-unstable.git] / arch / x86 / um / stub_32.S
bloba193e88536a904a54abf4177323e2d871825423a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <as-layout.h>
4 .section .__syscall_stub, "ax"
6         .globl batch_syscall_stub
7 batch_syscall_stub:
8         /* load pointer to first operation */
9         mov     $(STUB_DATA+8), %esp
11 again:
12         /* load length of additional data */
13         mov     0x0(%esp), %eax
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
21         /* save current pointer */
22         mov     %esp, STUB_DATA+4
24         /* skip additional data */
25         add     %eax, %esp
27         /* load syscall-# */
28         pop     %eax
30         /* load syscall params */
31         pop     %ebx
32         pop     %ecx
33         pop     %edx
34         pop     %esi
35         pop     %edi
36         pop     %ebp
38         /* execute syscall */
39         int     $0x80
41         /* check return value */
42         pop     %ebx
43         cmp     %ebx, %eax
44         je      again
46 done:
47         /* save return value */
48         mov     %eax, STUB_DATA
50         /* stop */
51         int3