3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-01 07:42:18 +00:00
Brooklyn/arch/x86/um/stub_32.S

52 lines
782 B
ArmAsm
Raw Normal View History

2021-05-26 19:09:36 +00:00
/* SPDX-License-Identifier: GPL-2.0 */
#include <as-layout.h>
.section .__syscall_stub, "ax"
.globl batch_syscall_stub
batch_syscall_stub:
2021-09-23 16:59:15 +00:00
/* load pointer to first operation */
mov $(STUB_DATA+8), %esp
2021-05-26 19:09:36 +00:00
again:
/* load length of additional data */
mov 0x0(%esp), %eax
/* if(length == 0) : end of list */
/* write possible 0 to header */
2021-09-23 16:59:15 +00:00
mov %eax, STUB_DATA+4
2021-05-26 19:09:36 +00:00
cmpl $0, %eax
jz done
/* save current pointer */
2021-09-23 16:59:15 +00:00
mov %esp, STUB_DATA+4
2021-05-26 19:09:36 +00:00
/* skip additional data */
add %eax, %esp
/* load syscall-# */
pop %eax
/* load syscall params */
pop %ebx
pop %ecx
pop %edx
pop %esi
pop %edi
pop %ebp
/* execute syscall */
int $0x80
/* check return value */
pop %ebx
cmp %ebx, %eax
je again
done:
/* save return value */
2021-09-23 16:59:15 +00:00
mov %eax, STUB_DATA
2021-05-26 19:09:36 +00:00
/* stop */
int3