stub_32.S 743 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include <as-layout.h>
  2. .section .__syscall_stub, "ax"
  3. .globl batch_syscall_stub
  4. batch_syscall_stub:
  5. /* load pointer to first operation */
  6. mov $(STUB_DATA+8), %esp
  7. again:
  8. /* load length of additional data */
  9. mov 0x0(%esp), %eax
  10. /* if(length == 0) : end of list */
  11. /* write possible 0 to header */
  12. mov %eax, STUB_DATA+4
  13. cmpl $0, %eax
  14. jz done
  15. /* save current pointer */
  16. mov %esp, STUB_DATA+4
  17. /* skip additional data */
  18. add %eax, %esp
  19. /* load syscall-# */
  20. pop %eax
  21. /* load syscall params */
  22. pop %ebx
  23. pop %ecx
  24. pop %edx
  25. pop %esi
  26. pop %edi
  27. pop %ebp
  28. /* execute syscall */
  29. int $0x80
  30. /* check return value */
  31. pop %ebx
  32. cmp %ebx, %eax
  33. je again
  34. done:
  35. /* save return value */
  36. mov %eax, STUB_DATA
  37. /* stop */
  38. int3