xref: /freebsd/sys/i386/linux/linux_locore.asm (revision 06c3fb27)
1
2#include "linux_assym.h"			/* system definitions */
3#include <machine/asmacros.h>			/* miscellaneous asm macros */
4
5#include <i386/linux/linux_syscall.h>		/* system call numbers */
6
7	.data
8
9	.globl linux_platform
10linux_platform:
11	.asciz "i686"
12
13	.text
14
15ENTRY(linux_vdso_sigcode)
16	.cfi_startproc
17	.cfi_signal_frame
18	.cfi_def_cfa	%esp, LINUX_SIGF_SC
19	.cfi_offset	%gs, L_SC_GS
20	.cfi_offset	%fs, L_SC_FS
21	.cfi_offset	%es, L_SC_ES
22	.cfi_offset	%ds, L_SC_DS
23	.cfi_offset	%cs, L_SC_CS
24	.cfi_offset	%ss, L_SC_SS
25#ifdef __clang__
26	.cfi_offset	%flags, L_SC_EFLAGS
27#else
28	.cfi_offset	%eflags, L_SC_EFLAGS
29#endif
30	.cfi_offset	%edi, L_SC_EDI
31	.cfi_offset	%esi, L_SC_ESI
32	.cfi_offset	%ebp, L_SC_EBP
33	.cfi_offset	%ebx, L_SC_EBX
34	.cfi_offset	%edx, L_SC_EDX
35	.cfi_offset	%ecx, L_SC_ECX
36	.cfi_offset	%eax, L_SC_EAX
37	.cfi_offset	%eip, L_SC_EIP
38	.cfi_offset	%esp, L_SC_ESP
39
40	movl	%esp, %ebx			/* sigframe for sigreturn */
41	call	*%edi				/* call signal handler */
42	popl	%eax				/* gcc unwind code need this */
43	.cfi_def_cfa	%esp, LINUX_SIGF_SC-4
44	movl	$LINUX_SYS_linux_sigreturn, %eax
45	int	$0x80
460:	jmp	0b
47	.cfi_endproc
48END(linux_vdso_sigcode)
49
50ENTRY(linux_vdso_rt_sigcode)
51	.cfi_startproc
52	.cfi_signal_frame
53	.cfi_def_cfa	%esp, LINUX_RT_SIGF_UC + LINUX_RT_SIGF_SC
54	.cfi_offset	%gs, L_SC_GS
55	.cfi_offset	%fs, L_SC_FS
56	.cfi_offset	%es, L_SC_ES
57	.cfi_offset	%ds, L_SC_DS
58	.cfi_offset	%cs, L_SC_CS
59	.cfi_offset	%ss, L_SC_SS
60#ifdef __clang__
61	.cfi_offset	%flags, L_SC_EFLAGS
62#else
63	.cfi_offset	%eflags, L_SC_EFLAGS
64#endif
65	.cfi_offset	%edi, L_SC_EDI
66	.cfi_offset	%esi, L_SC_ESI
67	.cfi_offset	%ebp, L_SC_EBP
68	.cfi_offset	%ebx, L_SC_EBX
69	.cfi_offset	%edx, L_SC_EDX
70	.cfi_offset	%ecx, L_SC_ECX
71	.cfi_offset	%eax, L_SC_EAX
72	.cfi_offset	%eip, L_SC_EIP
73	.cfi_offset	%esp, L_SC_ESP
74
75	leal	LINUX_RT_SIGF_UC(%esp), %ebx	/* linux ucontext for rt_sigreturn */
76	call	*%edi				/* call signal handler */
77	movl	$LINUX_SYS_linux_rt_sigreturn, %eax
78	int	$0x80
790:	jmp	0b
80	.cfi_endproc
81END(linux_vdso_rt_sigcode)
82
83ENTRY(__kernel_sigreturn)
84	.cfi_startproc
85	.cfi_signal_frame
86	popl	%eax				/* gcc unwind code need this */
87	movl	$LINUX_SYS_linux_sigreturn, %eax
88	int	$0x80
890:	jmp	0b
90	.cfi_endproc
91END(__kernel_sigreturn)
92
93ENTRY(__kernel_rt_sigreturn)
94	.cfi_startproc
95	.cfi_signal_frame
96	movl	$LINUX_SYS_linux_rt_sigreturn, %eax
97	int	$0x80
980:	jmp	0b
99	.cfi_endproc
100END(__kernel_rt_sigreturn)
101
102ENTRY(__kernel_vsyscall)
103	.cfi_startproc
104	int $0x80
105	ret
106	.cfi_endproc
107END(__kernel_vsyscall)
108
109#if 0
110	.section .note.Linux, "a",@note
111	.long 2f - 1f		/* namesz */
112	.balign 4
113	.long 4f - 3f		/* descsz */
114	.long 0
1151:
116	.asciz "Linux"
1172:
118	.balign 4
1193:
120	.long LINUX_VERSION_CODE
1214:
122	.balign 4
123	.previous
124#endif
125