]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - sys/amd64/linux/linux_locore.s
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.git] / sys / amd64 / linux / linux_locore.s
1 /* $FreeBSD$ */
2
3 #include "linux_assym.h"                        /* system definitions */
4 #include <machine/asmacros.h>                   /* miscellaneous asm macros */
5
6 #include <amd64/linux/linux_syscall.h>          /* system call numbers */
7
8         .data
9
10         .globl linux_platform
11 linux_platform:
12         .asciz "x86_64"
13
14
15         .text
16 /*
17  * To avoid excess stack frame the signal trampoline code emulates
18  * the 'call' instruction.
19  */
20 NON_GPROF_ENTRY(linux_rt_sigcode)
21         movq    %rsp, %rbx                      /* preserve sigframe */
22         call    .getip
23 .getip:
24         popq    %rax
25         add     $.startrtsigcode-.getip, %rax   /* ret address */
26         pushq   %rax
27         jmp     *LINUX_RT_SIGF_HANDLER(%rbx)
28 .startrtsigcode:
29         movq    $LINUX_SYS_linux_rt_sigreturn,%rax   /* linux_rt_sigreturn() */
30         syscall                                 /* enter kernel with args */
31         hlt
32 0:      jmp     0b
33
34 NON_GPROF_ENTRY(__vdso_clock_gettime)
35         movq    $LINUX_SYS_linux_clock_gettime,%rax
36         syscall
37         ret
38 .weak clock_gettime
39 .set clock_gettime, __vdso_clock_gettime
40
41 NON_GPROF_ENTRY(__vdso_time)
42         movq    $LINUX_SYS_linux_time,%rax
43         syscall
44         ret
45 .weak time
46 .set time, __vdso_time
47
48 NON_GPROF_ENTRY(__vdso_gettimeofday)
49         movq    $LINUX_SYS_gettimeofday,%rax
50         syscall
51         ret
52 .weak gettimeofday
53 .set gettimeofday, __vdso_gettimeofday
54
55 NON_GPROF_ENTRY(__vdso_getcpu)
56         movq    $-38,%rax       /* not implemented */
57         ret
58 .weak getcpu
59 .set getcpu, __vdso_getcpu
60
61 #if 0
62         .section .note.Linux, "a",@note
63         .long 2f - 1f           /* namesz */
64         .balign 4
65         .long 4f - 3f           /* descsz */
66         .long 0
67 1:
68         .asciz "Linux"
69 2:
70         .balign 4
71 3:
72         .long LINUX_VERSION_CODE
73 4:
74         .balign 4
75         .previous
76 #endif