1178739Sgonzo#include <machine/asm.h>
2178739Sgonzo__FBSDID("$FreeBSD$");
3178739Sgonzo
4178739Sgonzo	.section .init,"ax",%progbits
5178739Sgonzo	.align 4
6178739Sgonzo	.globl	_init
7178739Sgonzo	.type	_init,%function
8178739Sgonzo_init:
9205112Sjmallett	.set noreorder
10204674Simp#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
11204674Simp	SETUP_GP
12204674Simp#endif
13204674Simp	PTR_ADDU sp, sp, -CALLFRAME_SIZ
14204674Simp	REG_S	ra, CALLFRAME_RA(sp)
15204674Simp#if defined(__ABICALLS__)
16204674Simp#if defined(__mips_o32) || defined(__mips_o64)
17204674Simp	SAVE_GP(CALLFRAME_GP)
18178739Sgonzo#else
19204674Simp	SETUP_GP64(CALLFRAME_GP, _init)
20178739Sgonzo#endif
21204674Simp#else /* __ABICALLS__ */
22204674Simp#if defined(__mips_n32) || defined(__mips_n64)
23204674Simp	REG_S	gp, CALLFRAME_GP(sp)
24204674Simp#endif
25204674Simp#endif
26204674Simp	.set reorder
27178739Sgonzo
28178739Sgonzo	.section .fini,"ax",%progbits
29178739Sgonzo	.align 4
30178739Sgonzo	.globl	_fini
31178739Sgonzo	.type	_fini,%function
32178739Sgonzo_fini:
33204674Simp	.set noreorder
34204674Simp#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
35204674Simp	SETUP_GP
36204674Simp#endif
37204674Simp	PTR_ADDU sp, sp, -CALLFRAME_SIZ
38204674Simp	REG_S	ra, CALLFRAME_RA(sp)
39204674Simp#if defined(__ABICALLS__)
40204674Simp#if defined(__mips_o32) || defined(__mips_o64)
41204674Simp	SAVE_GP(CALLFRAME_GP)
42178739Sgonzo#else
43204674Simp	SETUP_GP64(CALLFRAME_GP, _fini)
44178739Sgonzo#endif
45204674Simp#else /* __ABICALLS__ */
46204674Simp#if defined(__mips_n32) || defined(__mips_n64)
47204674Simp	REG_S	gp, CALLFRAME_GP(sp)
48204674Simp#endif
49204674Simp#endif
50204674Simp	.set reorder
51