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