summaryrefslogtreecommitdiffstats
path: root/arch/mips/lib/genex.S
blob: 5fb222323133385929d2f67a1c4d98c33c2ff291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <asm/asm.h>
#include <asm/regdef.h>
#include <asm/mipsregs.h>
#include <asm/stackframe.h>

	.text
	.set	macro
	.set	noat
	.set	noreorder
	.align	5

/* Exception vector */
NESTED(handle_reserved, 0, sp)
	SAVE_ALL
	la	k0, barebox_exc_handler
	jal	k0
	 move	a0, sp
	/* will never return here */
	END(handle_reserved)

/* General exception vector */
NESTED(except_vec3_generic, 0, sp)
	.set	noat
	mfc0	k1, CP0_CAUSE
	la	k0, exception_handlers
	andi	k1, k1, 0x7c
	addu	k0, k0, k1
	lw	k0, (k0)
	nop
	jr	k0
	 nop
	END(except_vec3_generic)
	.set	at

FEXPORT(ret_from_exception)
	.set	noat
	RESTORE_ALL_AND_RET
	 nop
	.set	at