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