Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame] | 1 | #include "uml-config.h" |
| 2 | |
| 3 | .globl syscall_stub |
| 4 | .section .__syscall_stub, "x" |
Jeff Dike | c560049 | 2005-09-03 15:57:36 -0700 | [diff] [blame] | 5 | |
| 6 | .globl batch_syscall_stub |
| 7 | batch_syscall_stub: |
Bodo Stroesser | 07bf731 | 2005-09-03 15:57:50 -0700 | [diff] [blame] | 8 | /* load pointer to first operation */ |
| 9 | mov $(UML_CONFIG_STUB_DATA+8), %esp |
| 10 | |
| 11 | again: |
| 12 | /* load length of additional data */ |
| 13 | mov 0x0(%esp), %eax |
| 14 | |
| 15 | /* if(length == 0) : end of list */ |
| 16 | /* write possible 0 to header */ |
| 17 | mov %eax, UML_CONFIG_STUB_DATA+4 |
Jeff Dike | c560049 | 2005-09-03 15:57:36 -0700 | [diff] [blame] | 18 | cmpl $0, %eax |
| 19 | jz done |
Bodo Stroesser | 07bf731 | 2005-09-03 15:57:50 -0700 | [diff] [blame] | 20 | |
| 21 | /* save current pointer */ |
| 22 | mov %esp, UML_CONFIG_STUB_DATA+4 |
| 23 | |
| 24 | /* skip additional data */ |
| 25 | add %eax, %esp |
| 26 | |
| 27 | /* load syscall-# */ |
| 28 | pop %eax |
| 29 | |
| 30 | /* load syscall params */ |
Jeff Dike | c560049 | 2005-09-03 15:57:36 -0700 | [diff] [blame] | 31 | pop %ebx |
| 32 | pop %ecx |
| 33 | pop %edx |
| 34 | pop %esi |
| 35 | pop %edi |
| 36 | pop %ebp |
Bodo Stroesser | 07bf731 | 2005-09-03 15:57:50 -0700 | [diff] [blame] | 37 | |
| 38 | /* execute syscall */ |
Jeff Dike | c560049 | 2005-09-03 15:57:36 -0700 | [diff] [blame] | 39 | int $0x80 |
Bodo Stroesser | 07bf731 | 2005-09-03 15:57:50 -0700 | [diff] [blame] | 40 | |
| 41 | /* check return value */ |
| 42 | pop %ebx |
| 43 | cmp %ebx, %eax |
| 44 | je again |
| 45 | |
| 46 | done: |
| 47 | /* save return value */ |
Jeff Dike | c560049 | 2005-09-03 15:57:36 -0700 | [diff] [blame] | 48 | mov %eax, UML_CONFIG_STUB_DATA |
Bodo Stroesser | 07bf731 | 2005-09-03 15:57:50 -0700 | [diff] [blame] | 49 | |
| 50 | /* stop */ |
| 51 | int3 |