Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #include <as-layout.h>
0003 
0004 .section .__syscall_stub, "ax"
0005     .globl batch_syscall_stub
0006 batch_syscall_stub:
0007     /* %rsp has the pointer to first operation */
0008     mov %rsp, %rbx
0009     add $0x10, %rsp
0010 again:
0011     /* load length of additional data */
0012     mov 0x0(%rsp), %rax
0013 
0014     /* if(length == 0) : end of list */
0015     /* write possible 0 to header */
0016     mov %rax, 8(%rbx)
0017     cmp $0, %rax
0018     jz  done
0019 
0020     /* save current pointer */
0021     mov %rsp, 8(%rbx)
0022 
0023     /* skip additional data */
0024     add %rax, %rsp
0025 
0026     /* load syscall-# */
0027     pop %rax
0028 
0029     /* load syscall params */
0030     pop %rdi
0031     pop %rsi
0032     pop %rdx
0033     pop %r10
0034     pop %r8
0035     pop %r9
0036 
0037     /* execute syscall */
0038     syscall
0039 
0040     /* check return value */
0041     pop %rcx
0042     cmp %rcx, %rax
0043     je  again
0044 
0045 done:
0046     /* save return value */
0047     mov %rax, (%rbx)
0048 
0049     /* stop */
0050     int3