
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121  (619) 450-9333
15-24
BUS MASTERING WITH THE S5933 PCI MATCHMAKER
/***************************************************************************/
/*
Function:
handler
*/
/*
Purpose:
Check interrupt source and service S5933 int’s
*/
/*
Inputs:
None
*/
/*
Outputs:
None
*/
/***************************************************************************/
void interrupt handler(void)
{
byte
status;
status = inportb(op_reg_base_address+AMCC_OP_REG_INTCSR+2);
if((status & ANY_S5933_INT)!= 0){
/* Disable bus mastering */
outportb(op_reg_base_address+AMCC_OP_REG_MCSR+1,0x11);
/* Identify AMCC Interrupt Source(s) */
/* AMCC Hardware Interrupt Source */
if((status & READ_TC_INT) != 0)
/* Read TC Interrupt Code Here */
if((status & WRITE_TC_INT) != 0)
/* Write TC Interrupt Code Here */
if((status & MASTER_ABORT_INT) != 0)
/* Master Abort Interrupt Code Here */
if((status & TARGET_ABORT_INT) != 0)
/* Target Abort Interrupt Code Here */
/* Clear Interrupt Enables */
outportb(op_reg_base_address+AMCC_OP_REG_INTCSR+1,0);
/* Clear all active interrupt sources */
outportb(op_reg_base_address+AMCC_OP_REG_INTCSR+2,status);
/* Reenable transfer count interrupts */
outportb(op_reg_base_address+AMCC_OP_REG_INTCSR+1,0xC0);
}
else{
/* Not an S5933 Interrupt Source */
_chain_intr(oldhandler);
}
/* Specific End of interrupt to clear in-service bit(s)
*/
/* Mask upper 5 bits of int. line register
*/
if(interrupt_line<8)
outportb(0x20,0x60|(interrupt_line&0x07));
else{
/* Issue master then slave EOI */
outportb(0xa0,0x60|((interrupt_line-8)&0x07));
outportb(0x20,0x62);
}