kbuild: Fix instrumentation removal breakage on avr32
[wrt350n-kernel.git] / arch / um / sys-i386 / stub.S
blobe730772c401b53206810ceb387aa56b9f4f06cf9
1 #include "uml-config.h"
2 #include "as-layout.h"
4         .globl syscall_stub
5 .section .__syscall_stub, "x"
7         .globl batch_syscall_stub
8 batch_syscall_stub:
9         /* load pointer to first operation */
10         mov     $(ASM_STUB_DATA+8), %esp
12 again:
13         /* load length of additional data */
14         mov     0x0(%esp), %eax
16         /* if(length == 0) : end of list */
17         /* write possible 0 to header */
18         mov     %eax, ASM_STUB_DATA+4
19         cmpl    $0, %eax
20         jz      done
22         /* save current pointer */
23         mov     %esp, ASM_STUB_DATA+4
25         /* skip additional data */
26         add     %eax, %esp
28         /* load syscall-# */
29         pop     %eax
31         /* load syscall params */
32         pop     %ebx
33         pop     %ecx
34         pop     %edx
35         pop     %esi
36         pop     %edi
37         pop     %ebp
39         /* execute syscall */
40         int     $0x80
42         /* check return value */
43         pop     %ebx
44         cmp     %ebx, %eax
45         je      again
47 done:
48         /* save return value */
49         mov     %eax, ASM_STUB_DATA
51         /* stop */
52         int3