Sun Microelectronics
162
UltraSPARC User’s Manual
Note:
The processor may not send an interrupt vector to itself. This will cause
undefined interrupt vector data to be returned.
Code Example 9-1
Code Sequence For Interrupt Dispatch
Read state of ASI_INTR_DISPATCH_STATUS; Error if BUSY
<no pending interrupt dispatch packet>
Repeat
Begin atomic sequence
(PSTATE.IE
←
0)
Store to IV data reg 0 at ASI_UDB_INTR_W, VA=0x40 (optional)
Store to IV data reg 1 at ASI_UDB_INTR_W, VA=0x50 (optional)
Store to IV data reg 2 at ASI_UDB_INTR_W, VA=0x60 (optional)
Store to IV dispatch at ASI_UDB_INTR_W, VA<63:19>=0,
VA<18:14>=MID, VA<13:0>=0x70 initiates interrupt delivery
MEMBAR #Sync (wait for stores to finish)
Poll state of ASI_INTR_DISPATCH_STATUS (Busy, NACK)
Loop if BUSY
End atomic sequence
(PSTATE.IE
←
1)
DONE if !NACK
(Retry after random delay if NACKED)
Until DONE
Note:
In order to avoid deadlocks, interrupts must be enabled for some period
before retrying the atomic sequence. Alternatively, the atomic sequence can be
implemented using locks without disabling interrupts.
9.1.2 Interrupt Vector Receive
When an interrupt is received, all three interrupt data registers are updated, re-
gardless of which are being used by software. This is done along with the setting
of the BUSY bit in the ASI_INTR_RECEIVE register. At this point, the processor
inhibits further interrupt packets from the system bus. If interrupts are enabled
(PSTATE.IE=1), an
interrupt_vector
trap (implementation-dependent trap type 60
16
)
is generated. Software reads the ASI_INTR_RECEIVE register and incoming in-
terrupt data registers to determine the entry point of the appropriate trap han-
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com