posix-timers: move the initialization of timer->sigq from send to create path
[linux-2.6/mini2440.git] / arch / um / sys-x86_64 / stub.S
blob5687687631554dabc7e61719a4a900d8d5f691c1
1 #include "uml-config.h"
2 #include "as-layout.h"
4         .globl syscall_stub
5 .section .__syscall_stub, "x"
6 syscall_stub:
7         syscall
8         /* We don't have 64-bit constants, so this constructs the address
9          * we need.
10          */
11         movq    $(STUB_DATA >> 32), %rbx
12         salq    $32, %rbx
13         movq    $(STUB_DATA & 0xffffffff), %rcx
14         or      %rcx, %rbx
15         movq    %rax, (%rbx)
16         int3
18         .globl batch_syscall_stub
19 batch_syscall_stub:
20         mov     $(STUB_DATA >> 32), %rbx
21         sal     $32, %rbx
22         mov     $(STUB_DATA & 0xffffffff), %rax
23         or      %rax, %rbx
24         /* load pointer to first operation */
25         mov     %rbx, %rsp
26         add     $0x10, %rsp
27 again:
28         /* load length of additional data */
29         mov     0x0(%rsp), %rax
31         /* if(length == 0) : end of list */
32         /* write possible 0 to header */
33         mov     %rax, 8(%rbx)
34         cmp     $0, %rax
35         jz      done
37         /* save current pointer */
38         mov     %rsp, 8(%rbx)
40         /* skip additional data */
41         add     %rax, %rsp
43         /* load syscall-# */
44         pop     %rax
46         /* load syscall params */
47         pop     %rdi
48         pop     %rsi
49         pop     %rdx
50         pop     %r10
51         pop     %r8
52         pop     %r9
54         /* execute syscall */
55         syscall
57         /* check return value */
58         pop     %rcx
59         cmp     %rcx, %rax
60         je      again
62 done:
63         /* save return value */
64         mov     %rax, (%rbx)
66         /* stop */
67         int3