17c478bd9Sstevel@tonic-gate/*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
517e9c21cShyw * Common Development and Distribution License (the "License").
617e9c21cShyw * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate *
87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate * and limitations under the License.
127c478bd9Sstevel@tonic-gate *
137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate *
197c478bd9Sstevel@tonic-gate * CDDL HEADER END
207c478bd9Sstevel@tonic-gate */
217c478bd9Sstevel@tonic-gate/*
22023e71deSHaik Aftandilian * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate */
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gate#include "assym.h"
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate#include <sys/asm_linkage.h>
297c478bd9Sstevel@tonic-gate#include <sys/machthread.h>
307c478bd9Sstevel@tonic-gate#include <sys/machcpuvar.h>
317c478bd9Sstevel@tonic-gate#include <sys/mmu.h>
327c478bd9Sstevel@tonic-gate#include <sys/intreg.h>
337c478bd9Sstevel@tonic-gate#include <sys/dmv.h>
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gate#ifdef TRAPTRACE
367c478bd9Sstevel@tonic-gate#include <sys/traptrace.h>
377c478bd9Sstevel@tonic-gate#endif /* TRAPTRACE */
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gatevec_uiii_irdr_tab:
417c478bd9Sstevel@tonic-gate        .byte   UIII_IRDR_0, UIII_IRDR_1, UIII_IRDR_2, UIII_IRDR_3
427c478bd9Sstevel@tonic-gate        .byte   UIII_IRDR_4, UIII_IRDR_5, UIII_IRDR_6, UIII_IRDR_7
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate/*
457c478bd9Sstevel@tonic-gate * (TT 0x60, TL>0) Interrupt Vector Handler
467c478bd9Sstevel@tonic-gate *	Globals are the Interrupt Globals.
477c478bd9Sstevel@tonic-gate */
487c478bd9Sstevel@tonic-gate	ENTRY_NP(vec_interrupt)
497c478bd9Sstevel@tonic-gate	!
507c478bd9Sstevel@tonic-gate	! Load the interrupt receive data register 0.
517c478bd9Sstevel@tonic-gate	! It could be a fast trap handler address (pc > KERNELBASE) at TL>0
527c478bd9Sstevel@tonic-gate	! or an interrupt number.
537c478bd9Sstevel@tonic-gate	!
547c478bd9Sstevel@tonic-gate	mov	IRDR_0, %g2
557c478bd9Sstevel@tonic-gate	ldxa	[%g2]ASI_INTR_RECEIVE, %g5	! %g5 = PC or Interrupt Number
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate	! If the high bit of IRDR_0 is set, then this is a
587c478bd9Sstevel@tonic-gate	! data bearing mondo vector.
597c478bd9Sstevel@tonic-gate	brlz,pt %g5, dmv_vector
607c478bd9Sstevel@tonic-gate	.empty
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gate
63*55fea89dSDan Crossvec_interrupt_resume:
647c478bd9Sstevel@tonic-gate	set	KERNELBASE, %g4
657c478bd9Sstevel@tonic-gate	cmp	%g5, %g4
667c478bd9Sstevel@tonic-gate	bl,a,pt	%xcc, 0f			! an interrupt number found
677c478bd9Sstevel@tonic-gate	  nop
687c478bd9Sstevel@tonic-gate	!
697c478bd9Sstevel@tonic-gate	! intercept OBP xcalls and set PCONTEXT=0
707c478bd9Sstevel@tonic-gate	!
717c478bd9Sstevel@tonic-gate	set	_end, %g4		! _end is highest kernel address
727c478bd9Sstevel@tonic-gate	cmp	%g5, %g4
737c478bd9Sstevel@tonic-gate	bl,a,pt	%xcc, 7f
747c478bd9Sstevel@tonic-gate	  nop
75febcc4a5Sjimand
76febcc4a5Sjimand#ifndef _OPL
777c478bd9Sstevel@tonic-gate	mov	MMU_PCONTEXT, %g1
787c478bd9Sstevel@tonic-gate	ldxa	[%g1]ASI_DMMU, %g1
797c478bd9Sstevel@tonic-gate	srlx	%g1, CTXREG_NEXT_SHIFT, %g3
807c478bd9Sstevel@tonic-gate	brz,pt	%g3, 7f			! nucleus pgsz is 0, no problem
817c478bd9Sstevel@tonic-gate	  sllx	%g3, CTXREG_NEXT_SHIFT, %g3
827c478bd9Sstevel@tonic-gate	set	CTXREG_CTX_MASK, %g4	! check Pcontext
837c478bd9Sstevel@tonic-gate	btst	%g4, %g1
847c478bd9Sstevel@tonic-gate	bz,a,pt	%xcc, 6f
857c478bd9Sstevel@tonic-gate	  clr	%g3			! kernel:  PCONTEXT=0
867c478bd9Sstevel@tonic-gate	xor	%g3, %g1, %g3		! user:	clr N_pgsz0/1 bits
877c478bd9Sstevel@tonic-gate6:
887c478bd9Sstevel@tonic-gate	set	DEMAP_ALL_TYPE, %g1
897c478bd9Sstevel@tonic-gate	stxa	%g0, [%g1]ASI_DTLB_DEMAP
907c478bd9Sstevel@tonic-gate	stxa	%g0, [%g1]ASI_ITLB_DEMAP
917c478bd9Sstevel@tonic-gate	mov	MMU_PCONTEXT, %g1
927c478bd9Sstevel@tonic-gate	stxa	%g3, [%g1]ASI_DMMU
937c478bd9Sstevel@tonic-gate        membar  #Sync
947c478bd9Sstevel@tonic-gate	sethi	%hi(FLUSH_ADDR), %g1
957c478bd9Sstevel@tonic-gate	flush	%g1			! flush required by immu
96febcc4a5Sjimand#endif /* _OPL */
97febcc4a5Sjimand
987c478bd9Sstevel@tonic-gate7:
997c478bd9Sstevel@tonic-gate	!
1007c478bd9Sstevel@tonic-gate	!  Cross-trap request case
1017c478bd9Sstevel@tonic-gate	!
1027c478bd9Sstevel@tonic-gate	! Load interrupt receive data registers 1 and 2 to fetch
1037c478bd9Sstevel@tonic-gate	! the arguments for the fast trap handler.
1047c478bd9Sstevel@tonic-gate	!
1057c478bd9Sstevel@tonic-gate	! Register usage:
1067c478bd9Sstevel@tonic-gate	!	g5: TL>0 handler
1077c478bd9Sstevel@tonic-gate	!	g1: arg1
1087c478bd9Sstevel@tonic-gate	!	g2: arg2
1097c478bd9Sstevel@tonic-gate	!	g3: arg3
1107c478bd9Sstevel@tonic-gate	!	g4: arg4
1117c478bd9Sstevel@tonic-gate	!
1127c478bd9Sstevel@tonic-gate	mov	IRDR_1, %g2
1137c478bd9Sstevel@tonic-gate	ldxa	[%g2]ASI_INTR_RECEIVE, %g1
1147c478bd9Sstevel@tonic-gate	mov	IRDR_2, %g2
1157c478bd9Sstevel@tonic-gate	ldxa	[%g2]ASI_INTR_RECEIVE, %g2
1167c478bd9Sstevel@tonic-gate#ifdef TRAPTRACE
1177c478bd9Sstevel@tonic-gate	TRACE_PTR(%g4, %g6)
118023e71deSHaik Aftandilian	GET_TRACE_TICK(%g6, %g3)
1197c478bd9Sstevel@tonic-gate	stxa	%g6, [%g4 + TRAP_ENT_TICK]%asi
1207c478bd9Sstevel@tonic-gate	rdpr	%tl, %g6
1217c478bd9Sstevel@tonic-gate	stha	%g6, [%g4 + TRAP_ENT_TL]%asi
1227c478bd9Sstevel@tonic-gate	rdpr	%tt, %g6
1237c478bd9Sstevel@tonic-gate	stha	%g6, [%g4 + TRAP_ENT_TT]%asi
1247c478bd9Sstevel@tonic-gate	rdpr	%tpc, %g6
1257c478bd9Sstevel@tonic-gate	stna	%g6, [%g4 + TRAP_ENT_TPC]%asi
1267c478bd9Sstevel@tonic-gate	rdpr	%tstate, %g6
1277c478bd9Sstevel@tonic-gate	stxa	%g6, [%g4 + TRAP_ENT_TSTATE]%asi
1287c478bd9Sstevel@tonic-gate	stna	%sp, [%g4 + TRAP_ENT_SP]%asi
1297c478bd9Sstevel@tonic-gate	stna	%g5, [%g4 + TRAP_ENT_TR]%asi	! pc of the TL>0 handler
1307c478bd9Sstevel@tonic-gate	stxa	%g1, [%g4 + TRAP_ENT_F1]%asi
1317c478bd9Sstevel@tonic-gate	stxa	%g2, [%g4 + TRAP_ENT_F3]%asi
1327c478bd9Sstevel@tonic-gate	stxa	%g0, [%g4 + TRAP_ENT_F2]%asi
1337c478bd9Sstevel@tonic-gate	stxa	%g0, [%g4 + TRAP_ENT_F4]%asi
1347c478bd9Sstevel@tonic-gate	TRACE_NEXT(%g4, %g6, %g3)
1357c478bd9Sstevel@tonic-gate#endif /* TRAPTRACE */
1367c478bd9Sstevel@tonic-gate	stxa	%g0, [%g0]ASI_INTR_RECEIVE_STATUS	! clear the BUSY bit
1377c478bd9Sstevel@tonic-gate	membar	#Sync
1387c478bd9Sstevel@tonic-gate#ifdef SF_ERRATA_51
1397c478bd9Sstevel@tonic-gate	ba,pt	%icc, 1f
1407c478bd9Sstevel@tonic-gate	nop
1417c478bd9Sstevel@tonic-gate	.align 32
1427c478bd9Sstevel@tonic-gate1:	jmp	%g5				! call the fast trap handler
1437c478bd9Sstevel@tonic-gate	nop
1447c478bd9Sstevel@tonic-gate#else
1457c478bd9Sstevel@tonic-gate	jmp	%g5
1467c478bd9Sstevel@tonic-gate	nop
1477c478bd9Sstevel@tonic-gate#endif /* SF_ERRATA_51 */
1487c478bd9Sstevel@tonic-gate	/* Never Reached */
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gate0:
1517c478bd9Sstevel@tonic-gate	! We have an interrupt number.
1527c478bd9Sstevel@tonic-gate        !
1537c478bd9Sstevel@tonic-gate	! Register usage:
1547c478bd9Sstevel@tonic-gate	!	%g5 - inum
1557c478bd9Sstevel@tonic-gate	!	%g1 - temp
1567c478bd9Sstevel@tonic-gate	!
1577c478bd9Sstevel@tonic-gate        ! We don't bother to verify that the received inum is valid (it should
158b0fc0e77Sgovinda        ! be < MAXIVNUM) since setvecint_tl1 will do that for us.
1597c478bd9Sstevel@tonic-gate        !
1607c478bd9Sstevel@tonic-gate	! clear BUSY bit
1617c478bd9Sstevel@tonic-gate	!
1627c478bd9Sstevel@tonic-gate	stxa	%g0, [%g0]ASI_INTR_RECEIVE_STATUS
1637c478bd9Sstevel@tonic-gate	membar	#Sync
1647c478bd9Sstevel@tonic-gate
165b0fc0e77Sgovinda	! setvecint_tl1 will do all the work, and finish with a retry
1667c478bd9Sstevel@tonic-gate	!
167b0fc0e77Sgovinda	ba,pt	%xcc, setvecint_tl1
168b0fc0e77Sgovinda	mov	%g5, %g1		! setvecint_tl1 expects inum in %g1
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gate	/* Never Reached */
1717c478bd9Sstevel@tonic-gate	SET_SIZE(vec_interrupt)
1727c478bd9Sstevel@tonic-gate
1737c478bd9Sstevel@tonic-gate
174*55fea89dSDan Cross!
1757c478bd9Sstevel@tonic-gate!   See usr/src/uts/sun4u/sys/dmv.h for the Databearing Mondo Vector
1767c478bd9Sstevel@tonic-gate!	 interrupt format
1777c478bd9Sstevel@tonic-gate!
1787c478bd9Sstevel@tonic-gate! Inputs:
1797c478bd9Sstevel@tonic-gate!	g1: value of ASI_INTR_RECEIVE_STATUS
1807c478bd9Sstevel@tonic-gate!	g5: word 0 of the interrupt data
1817c478bd9Sstevel@tonic-gate! Register use:
1827c478bd9Sstevel@tonic-gate!	g2: dmv inum
1837c478bd9Sstevel@tonic-gate!	g3: scratch
1847c478bd9Sstevel@tonic-gate!	g4: pointer to dmv_dispatch_table
1857c478bd9Sstevel@tonic-gate!	g6: handler pointer from dispatch table
1867c478bd9Sstevel@tonic-gate
1877c478bd9Sstevel@tonic-gate
1887c478bd9Sstevel@tonic-gate	DGDEF(dmv_spurious_cnt)
1897c478bd9Sstevel@tonic-gate	.word	0
1907c478bd9Sstevel@tonic-gate
1917c478bd9Sstevel@tonic-gate	ENTRY_NP(dmv_vector)
1927c478bd9Sstevel@tonic-gate	srlx	%g5, DMV_INUM_SHIFT, %g2
1937c478bd9Sstevel@tonic-gate	set	DMV_INUM_MASK, %g3
1947c478bd9Sstevel@tonic-gate	and	%g2, %g3, %g2		   ! %g2 = inum
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate	set	dmv_totalints, %g3
1977c478bd9Sstevel@tonic-gate	ld	[%g3], %g3
1987c478bd9Sstevel@tonic-gate	cmp	%g2, %g3
1997c478bd9Sstevel@tonic-gate	bge,pn	%xcc, 2f		   ! inum >= dmv_totalints
2007c478bd9Sstevel@tonic-gate	nop
201*55fea89dSDan Cross
2027c478bd9Sstevel@tonic-gate	set	dmv_dispatch_table, %g3
2037c478bd9Sstevel@tonic-gate	ldn	[%g3], %g4
2047c478bd9Sstevel@tonic-gate	brz,pn	%g4, 2f
2057c478bd9Sstevel@tonic-gate	sll	%g2, DMV_DISP_SHIFT, %g3   ! %g3 = inum*sizeof(struct dmv_disp)
206*55fea89dSDan Cross
2077c478bd9Sstevel@tonic-gate	add	%g4, %g3, %g4		! %g4 = &dmv_dispatch_table[inum]
2087c478bd9Sstevel@tonic-gate#if (DMV_FUNC != 0) || (DMV_ARG != 8)
2097c478bd9Sstevel@tonic-gate#error "DMV_FUNC or DMV_SIZE has changed"
2107c478bd9Sstevel@tonic-gate#endif
2117c478bd9Sstevel@tonic-gate	ldda	[%g4]ASI_NQUAD_LD, %g2  ! %g2=handler %g3=argument
2127c478bd9Sstevel@tonic-gate	mov	%g3, %g1
213*55fea89dSDan Cross	brz,pn  %g2, 2f
2147c478bd9Sstevel@tonic-gate	nop
215*55fea89dSDan Cross
2167c478bd9Sstevel@tonic-gate	! we have a handler, so call it
2177c478bd9Sstevel@tonic-gate	! On entry to the handler, the %g registers are set as follows:
2187c478bd9Sstevel@tonic-gate	!
2197c478bd9Sstevel@tonic-gate	!	%g1	The argument (arg) passed to dmv_add_intr().
2207c478bd9Sstevel@tonic-gate	!	%g2	Word 0 of the incoming mondo vector.
2217c478bd9Sstevel@tonic-gate	!
2227c478bd9Sstevel@tonic-gate	jmp	%g2
2237c478bd9Sstevel@tonic-gate	mov	%g5, %g2
224*55fea89dSDan Cross
2257c478bd9Sstevel@tonic-gate	! No handler was listed in the table, so just record it
2267c478bd9Sstevel@tonic-gate	! as an error condition and continue.  There is a race
2277c478bd9Sstevel@tonic-gate	! window here updating the counter, but that's ok since
2287c478bd9Sstevel@tonic-gate	! just knowing that spurious interrupts happened is enough,
2297c478bd9Sstevel@tonic-gate	! we probably won't need to know exactly how many.
2307c478bd9Sstevel@tonic-gate2:
2317c478bd9Sstevel@tonic-gate	set	dmv_spurious_cnt, %g1
2327c478bd9Sstevel@tonic-gate	ld	[%g1], %g2
2337c478bd9Sstevel@tonic-gate	inc	%g2
2347c478bd9Sstevel@tonic-gate	ba,pt	%xcc,3f
2357c478bd9Sstevel@tonic-gate	st	%g2, [%g1]
236*55fea89dSDan Cross
2377c478bd9Sstevel@tonic-gate	!	When the handler's processing (which should be as quick as
2387c478bd9Sstevel@tonic-gate	!	possible) is complete, the handler must exit by jumping to
2397c478bd9Sstevel@tonic-gate	!	the label dmv_finish_intr.  The contents of %g1 at this time
2407c478bd9Sstevel@tonic-gate	!	determine whether a software interrupt will be issued, as
2417c478bd9Sstevel@tonic-gate	!	follows:
2427c478bd9Sstevel@tonic-gate	!
2437c478bd9Sstevel@tonic-gate	!		If %g1 is less than zero, no interrupt will be queued.
2447c478bd9Sstevel@tonic-gate	!		Otherwise, %g1 will be used as the interrupt number
2457c478bd9Sstevel@tonic-gate	!		to simulate; this means that the behavior of the
2467c478bd9Sstevel@tonic-gate	!		interrupt system will be exactly that which would have
2477c478bd9Sstevel@tonic-gate	!		occurred if the first word of the incoming interrupt
2487c478bd9Sstevel@tonic-gate	!		vector had contained the contents of %g1.
2497c478bd9Sstevel@tonic-gate
2507c478bd9Sstevel@tonic-gate	ENTRY_NP(dmv_finish_intr)
2517c478bd9Sstevel@tonic-gate	brlz,pn %g1,3f
2527c478bd9Sstevel@tonic-gate	nop
2537c478bd9Sstevel@tonic-gate	!	generate an interrupt based on the contents of %g1
2547c478bd9Sstevel@tonic-gate	ba,pt	%xcc,vec_interrupt_resume
2557c478bd9Sstevel@tonic-gate	mov	%g1, %g5
2567c478bd9Sstevel@tonic-gate	!	We are done
257*55fea89dSDan Cross3:
2587c478bd9Sstevel@tonic-gate	stxa	%g0, [%g0]ASI_INTR_RECEIVE_STATUS ! clear the busy bit
2597c478bd9Sstevel@tonic-gate	retry
2607c478bd9Sstevel@tonic-gate	SET_SIZE(dmv_vector)
2617c478bd9Sstevel@tonic-gate
2627c478bd9Sstevel@tonic-gate	DGDEF(vec_spurious_cnt)
2637c478bd9Sstevel@tonic-gate	.word	0
2647c478bd9Sstevel@tonic-gate
2657c478bd9Sstevel@tonic-gate	ENTRY_NP(vec_intr_spurious)
2667c478bd9Sstevel@tonic-gate	sethi	%hi(vec_spurious_cnt), %g2
2677c478bd9Sstevel@tonic-gate	ld	[%g2 + %lo(vec_spurious_cnt)], %g2
2687c478bd9Sstevel@tonic-gate#ifdef TRAPTRACE
2697c478bd9Sstevel@tonic-gate	TRACE_PTR(%g4, %g6)
270023e71deSHaik Aftandilian	GET_TRACE_TICK(%g6, %g3)
2717c478bd9Sstevel@tonic-gate	stxa	%g6, [%g4 + TRAP_ENT_TICK]%asi
2727c478bd9Sstevel@tonic-gate	rdpr	%tl, %g6
2737c478bd9Sstevel@tonic-gate	stha	%g6, [%g4 + TRAP_ENT_TL]%asi
2747c478bd9Sstevel@tonic-gate	rdpr	%tt, %g6
2757c478bd9Sstevel@tonic-gate	or	%g6, TT_SPURIOUS_INT, %g6
2767c478bd9Sstevel@tonic-gate	stha	%g6, [%g4 + TRAP_ENT_TT]%asi
2777c478bd9Sstevel@tonic-gate	rdpr	%tpc, %g6
2787c478bd9Sstevel@tonic-gate	stna	%g6, [%g4 + TRAP_ENT_TPC]%asi
2797c478bd9Sstevel@tonic-gate	rdpr	%tstate, %g6
2807c478bd9Sstevel@tonic-gate	stxa	%g6, [%g4 + TRAP_ENT_TSTATE]%asi
2817c478bd9Sstevel@tonic-gate	stna	%sp, [%g4 + TRAP_ENT_SP]%asi
2827c478bd9Sstevel@tonic-gate	stna	%g1, [%g4 + TRAP_ENT_TR]%asi	! irsr
2837c478bd9Sstevel@tonic-gate	stna	%g2, [%g4 + TRAP_ENT_F1]%asi
2847c478bd9Sstevel@tonic-gate	ldxa	[%g0]ASI_INTR_RECEIVE_STATUS, %g5
2857c478bd9Sstevel@tonic-gate	stxa	%g5, [%g4 + TRAP_ENT_F2]%asi
2867c478bd9Sstevel@tonic-gate	stxa	%g0, [%g4 + TRAP_ENT_F4]%asi
2877c478bd9Sstevel@tonic-gate	TRACE_NEXT(%g4, %g6, %g3)
2887c478bd9Sstevel@tonic-gate#endif /* TRAPTRACE */
2897c478bd9Sstevel@tonic-gate	cmp	%g2, 16
2907c478bd9Sstevel@tonic-gate	bl,a,pt	%xcc, 1f
2917c478bd9Sstevel@tonic-gate	inc	%g2
2927c478bd9Sstevel@tonic-gate	!
2937c478bd9Sstevel@tonic-gate	! prepare for sys_trap()
2947c478bd9Sstevel@tonic-gate	!	%g1 - sys_tl1_panic
2957c478bd9Sstevel@tonic-gate	!	%g2 - panic message
2967c478bd9Sstevel@tonic-gate	!	%g4 - current pil
2977c478bd9Sstevel@tonic-gate	!
29817e9c21cShyw#ifdef CLEAR_INTR_BUSYBIT_ON_SPURIOUS
29917e9c21cShyw	/*
30017e9c21cShyw	 * Certain processors (OPL) need to explicitly
30117e9c21cShyw	 * clear the intr busy bit even though it is
30217e9c21cShyw	 * not visibly set (spurious intrs)
30317e9c21cShyw	 */
30417e9c21cShyw	stxa	%g0, [%g0]ASI_INTR_RECEIVE_STATUS	! clear the BUSY bit
30517e9c21cShyw	membar  #Sync
30617e9c21cShyw#endif /* CLEAR_INTR_BUSYBIT_ON_SPURIOUS */
3077c478bd9Sstevel@tonic-gate	sub	%g0, 1, %g4
3087c478bd9Sstevel@tonic-gate	set	_not_ready, %g2
3097c478bd9Sstevel@tonic-gate	sethi	%hi(sys_tl1_panic), %g1
3107c478bd9Sstevel@tonic-gate	ba,pt	%xcc, sys_trap
3117c478bd9Sstevel@tonic-gate	or	%g1, %lo(sys_tl1_panic), %g1
3127c478bd9Sstevel@tonic-gate	!
3137c478bd9Sstevel@tonic-gate1:	sethi	%hi(vec_spurious_cnt), %g1
3147c478bd9Sstevel@tonic-gate	st	%g2, [%g1 + %lo(vec_spurious_cnt)]
3157c478bd9Sstevel@tonic-gate	retry
3167c478bd9Sstevel@tonic-gate	SET_SIZE(vec_intr_spurious)
3177c478bd9Sstevel@tonic-gate
3187c478bd9Sstevel@tonic-gate_not_ready:	.asciz	"Interrupt Vector Receive Register not READY"
3197c478bd9Sstevel@tonic-gate
320