1/* $FreeBSD: releng/10.3/sys/amd64/linux/linux_locore.s 293536 2016-01-09 16:25:30Z dchagin $ */
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
11linux_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 */
20NON_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
320:	jmp	0b
33
34NON_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
41NON_GPROF_ENTRY(__vdso_time)
42	movq	$LINUX_SYS_linux_time,%rax
43	syscall
44	ret
45.weak time
46.set time, __vdso_time
47
48NON_GPROF_ENTRY(__vdso_gettimeofday)
49	movq	$LINUX_SYS_gettimeofday,%rax
50	syscall
51	ret
52.weak gettimeofday
53.set gettimeofday, __vdso_gettimeofday
54
55NON_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
671:
68	.asciz "Linux"
692:
70	.balign 4
713:
72	.long LINUX_VERSION_CODE
734:
74	.balign 4
75	.previous
76#endif
77