/* C interrupt intialization program interrupt1.c. */ #include "SparcSoftcard.h" #include "SparcSoftcardOps.h" void InitInterrupts() { /* The processor arrives here all interrupt masked, with every potential interrupt soucre in an unknown state. This procedure reset all interprocessor interrupt lines, sets all peripheral interrupts to inactive and resets the interrupt mask bits. */ /* reset all interprocessor interrupt lines */ SparcSoftcardOps_ResetSparcToIOPInt(); SparcSoftcardOps_ResetSparcToMesaInt(); SparcSoftcardOps_ResetSparcToSparcInt(); SparcSoftcardOps_ResetIOPToSparcInt(); SparcSoftcardOps_ResetMesaToSparcInt(); SparcSoftcardOps_ResetSparcAbortInt(); /* sets all peripheral interrupts to inactive */ SparcSoftcardOps_SetPeriphIntMode(InterruptSource_mapInt, InterruptMode_activeLow, InterruptNumber_interruptA, InterruptProcessor_none); SparcSoftcardOps_SetPeriphIntMode(InterruptSource_mapInt, InterruptMode_activeLow, InterruptNumber_interruptB, InterruptProcessor_none); SparcSoftcardOps_SetPeriphIntMode(InterruptSource_mapInt, InterruptMode_activeLow, InterruptNumber_interruptC, InterruptProcessor_none); /* reset the interrupt mask bits */ asm("mov %g1, %o0"); asm("rd %psr, %g1"); asm("and %g1, ~0xf00, %g1"); asm("wr %g1, %g0, %psr"); asm("nop"); asm("nop"); asm("nop"); asm("mov %o0, %g1"); }; void SetInterruptA() { /* Sets interrupt A to the real time clock interrupt. */ SparcSoftcardOps_SetPeriphIntMode(InterruptSource_realTimeClock, InterruptMode_risingEdge, InterruptNumber_interruptA, InterruptProcessor_sparc); }; void SetInterruptB() { /* Sets interrupt B to the real time clock interrupt. */ SparcSoftcardOps_SetPeriphIntMode(InterruptSource_PrintVersEnd, InterruptMode_risingEdge, InterruptNumber_interruptB, InterruptProcessor_sparc); };