License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / arch / x86 / um / stub_64.S
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
37185b33 2#include <as-layout.h>
d67b569f 3
276c974a 4.section .__syscall_stub, "ax"
c5600490
JD
5 .globl batch_syscall_stub
6batch_syscall_stub:
1b2411c2 7 mov $(STUB_DATA), %rbx
07bf731e
BS
8 /* load pointer to first operation */
9 mov %rbx, %rsp
10 add $0x10, %rsp
11again:
12 /* load length of additional data */
13 mov 0x0(%rsp), %rax
14
15 /* if(length == 0) : end of list */
16 /* write possible 0 to header */
17 mov %rax, 8(%rbx)
18 cmp $0, %rax
19 jz done
20
21 /* save current pointer */
22 mov %rsp, 8(%rbx)
23
24 /* skip additional data */
25 add %rax, %rsp
26
27 /* load syscall-# */
28 pop %rax
29
30 /* load syscall params */
c5600490
JD
31 pop %rdi
32 pop %rsi
33 pop %rdx
34 pop %r10
35 pop %r8
36 pop %r9
07bf731e
BS
37
38 /* execute syscall */
c5600490 39 syscall
07bf731e
BS
40
41 /* check return value */
42 pop %rcx
43 cmp %rcx, %rax
44 je again
45
46done:
47 /* save return value */
c5600490 48 mov %rax, (%rbx)
07bf731e
BS
49
50 /* stop */
51 int3