xref: /openbmc/linux/arch/sparc/kernel/misctrap.S (revision bc5aa3a0)
1#ifdef CONFIG_KGDB
2	.globl		arch_kgdb_breakpoint
3	.type		arch_kgdb_breakpoint,#function
4arch_kgdb_breakpoint:
5	ta		0x72
6	retl
7	 nop
8	.size		arch_kgdb_breakpoint,.-arch_kgdb_breakpoint
9#endif
10
11	.type		__do_privact,#function
12__do_privact:
13	mov		TLB_SFSR, %g3
14	stxa		%g0, [%g3] ASI_DMMU	! Clear FaultValid bit
15	membar		#Sync
16	sethi		%hi(109f), %g7
17	ba,pt		%xcc, etrap
18109:	or		%g7, %lo(109b), %g7
19	call		do_privact
20	 add		%sp, PTREGS_OFF, %o0
21	ba,a,pt		%xcc, rtrap
22	.size		__do_privact,.-__do_privact
23
24	.type		do_mna,#function
25do_mna:
26	rdpr		%tl, %g3
27	cmp		%g3, 1
28
29	/* Setup %g4/%g5 now as they are used in the
30	 * winfixup code.
31	 */
32	mov		TLB_SFSR, %g3
33	mov		DMMU_SFAR, %g4
34	ldxa		[%g4] ASI_DMMU, %g4
35	ldxa		[%g3] ASI_DMMU, %g5
36	stxa		%g0, [%g3] ASI_DMMU	! Clear FaultValid bit
37	membar		#Sync
38	bgu,pn		%icc, winfix_mna
39	 rdpr		%tpc, %g3
40
411:	sethi		%hi(109f), %g7
42	ba,pt		%xcc, etrap
43109:	 or		%g7, %lo(109b), %g7
44	mov		%l4, %o1
45	mov		%l5, %o2
46	call		mem_address_unaligned
47	 add		%sp, PTREGS_OFF, %o0
48	ba,a,pt		%xcc, rtrap
49	.size		do_mna,.-do_mna
50
51	.type		do_lddfmna,#function
52do_lddfmna:
53	sethi		%hi(109f), %g7
54	mov		TLB_SFSR, %g4
55	ldxa		[%g4] ASI_DMMU, %g5
56	stxa		%g0, [%g4] ASI_DMMU	! Clear FaultValid bit
57	membar		#Sync
58	mov		DMMU_SFAR, %g4
59	ldxa		[%g4] ASI_DMMU, %g4
60	ba,pt		%xcc, etrap
61109:	 or		%g7, %lo(109b), %g7
62	mov		%l4, %o1
63	mov		%l5, %o2
64	call		handle_lddfmna
65	 add		%sp, PTREGS_OFF, %o0
66	ba,a,pt		%xcc, rtrap
67	.size		do_lddfmna,.-do_lddfmna
68
69	.type		do_stdfmna,#function
70do_stdfmna:
71	sethi		%hi(109f), %g7
72	mov		TLB_SFSR, %g4
73	ldxa		[%g4] ASI_DMMU, %g5
74	stxa		%g0, [%g4] ASI_DMMU	! Clear FaultValid bit
75	membar		#Sync
76	mov		DMMU_SFAR, %g4
77	ldxa		[%g4] ASI_DMMU, %g4
78	ba,pt		%xcc, etrap
79109:	 or		%g7, %lo(109b), %g7
80	mov		%l4, %o1
81	mov		%l5, %o2
82	call		handle_stdfmna
83	 add		%sp, PTREGS_OFF, %o0
84	ba,a,pt		%xcc, rtrap
85	.size		do_stdfmna,.-do_stdfmna
86
87	.type		breakpoint_trap,#function
88breakpoint_trap:
89	call		sparc_breakpoint
90	 add		%sp, PTREGS_OFF, %o0
91	ba,pt		%xcc, rtrap
92	 nop
93	.size		breakpoint_trap,.-breakpoint_trap
94