# HG changeset patch # User nickg # Date 1065031600 0 # Node ID c5a75fb0568af10d4bfffd8059f10f3f52fc3729 # Parent 13ba50dd5a8e71e59eefcf041a42bc5acc82845f * include/plf_io.h: Fixed implementation of HAL_PCI_TRANSLATE_INTERRUPT * include/plf_intr.h: Applied assembly safe fix diff --git a/packages/hal/mips/atlas/current/ChangeLog b/packages/hal/mips/atlas/current/ChangeLog --- a/packages/hal/mips/atlas/current/ChangeLog +++ b/packages/hal/mips/atlas/current/ChangeLog @@ -1,3 +1,9 @@ +2003-09-28 Michael Anburaj + + * include/plf_io.h: Fixed implementation of + HAL_PCI_TRANSLATE_INTERRUPT + * include/plf_intr.h: Applied assembly safe fix + 2003-07-18 Nick Garnett * cdl/hal_mips_atlas.cdl: diff --git a/packages/hal/mips/atlas/current/include/plf_intr.h b/packages/hal/mips/atlas/current/include/plf_intr.h --- a/packages/hal/mips/atlas/current/include/plf_intr.h +++ b/packages/hal/mips/atlas/current/include/plf_intr.h @@ -45,7 +45,7 @@ // // Author(s): nickg // Contributors: nickg, jskov, -// gthomas, jlarmour, dmoseley +// gthomas, jlarmour, dmoseley, michael anburaj // Date: 2000-06-06 // Purpose: Define Interrupt support // Description: The macros defined here provide the HAL APIs for handling @@ -62,8 +62,7 @@ #include -#include -#include +// First an assembly safe part //-------------------------------------------------------------------------- // Interrupt vectors. @@ -112,6 +111,12 @@ #endif + +//-------------------------------------------------------------------------- +#ifndef __ASSEMBLER__ + +#include + //-------------------------------------------------------------------------- // Interrupt controller access. @@ -233,6 +238,8 @@ extern void hal_atlas_reset( void ); #endif // CYGHWR_HAL_RESET_DEFINED +#endif // __ASSEMBLER__ + //-------------------------------------------------------------------------- #endif // ifndef CYGONCE_HAL_PLF_INTR_H // End of plf_intr.h diff --git a/packages/hal/mips/atlas/current/include/plf_io.h b/packages/hal/mips/atlas/current/include/plf_io.h --- a/packages/hal/mips/atlas/current/include/plf_io.h +++ b/packages/hal/mips/atlas/current/include/plf_io.h @@ -44,7 +44,7 @@ //#####DESCRIPTIONBEGIN#### // // Author(s): dmoseley -// Contributors: dmoseley +// Contributors: dmoseley, michael anburaj // Date: 2000-06-06 // Purpose: Atlas platform IO support // Description: @@ -56,6 +56,8 @@ #include #include +#include +#include #ifdef __ASSEMBLER__ #define HAL_REG(x) x @@ -453,7 +455,30 @@ externC void cyg_hal_plf_pci_init(void); // INTC# or INTD#) to the associated CPU interrupt (i.e., HAL vector). #define HAL_PCI_TRANSLATE_INTERRUPT( __bus, __devfn, __vec, __valid) \ CYG_MACRO_START \ - __valid = false; \ + cyg_uint8 __req; \ + HAL_PCI_CFG_READ_UINT8(__bus, __devfn, CYG_PCI_CFG_INT_PIN, __req); \ + if (0 != __req) { \ + CYG_ADDRWORD __translation[4] = { \ + CYGNUM_HAL_INTERRUPT_INTA, \ + CYGNUM_HAL_INTERRUPT_INTB, \ + CYGNUM_HAL_INTERRUPT_INTC, \ + CYGNUM_HAL_INTERRUPT_INTD}; \ + \ + /* The PCI #INT lines for different device numbers are wired like this: */ \ + /* */ \ + /* Int. Ctrl. PCI_A PCI_B PCI_C PCI_D */ \ + /* Device no. */ \ + /* 0, 4, ..28 INTC# INTD# INTA# INTB# */ \ + /* 1, 5, ..29 INTD# INTA# INTB# INTC# */ \ + /* 2, 6, ..30 INTA# INTB# INTC# INTD# */ \ + /* 3, 7, ..31 INTB# INTC# INTD# INTA# */ \ + \ + __vec = __translation[(((__req+1)+CYG_PCI_DEV_GET_DEV(__devfn))&3)]; \ + __valid = true; \ + } else { \ + /* Device will not generate interrupt requests. */ \ + __valid = false; \ + } \ CYG_MACRO_END