/trunk/kernel/genarch/include/ofw/ofw_tree.h |
---|
115,7 → 115,7 |
uint32_t addr; |
uint32_t intr; |
uint32_t controller_handle; |
uint32_t controller_ino; |
uint32_t controller_inr; |
} __attribute__ ((packed)); |
typedef struct ofw_ebus_intr_map ofw_ebus_intr_map_t; |
165,7 → 165,7 |
extern bool ofw_pci_reg_absolutize(ofw_tree_node_t *node, ofw_pci_reg_t *reg, ofw_pci_reg_t *out); |
extern bool ofw_fhc_map_interrupts(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *ino); |
extern bool ofw_ebus_map_interrupts(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *ino); |
extern bool ofw_fhc_map_interrupts(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *inr); |
extern bool ofw_ebus_map_interrupts(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *inr); |
#endif |
/trunk/kernel/genarch/src/ofw/ebus.c |
---|
74,7 → 74,7 |
return false; |
} |
bool ofw_ebus_map_interrupts(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *ino) |
bool ofw_ebus_map_interrupts(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *inr) |
{ |
ofw_tree_property_t *prop; |
ofw_tree_node_t *controller; |
111,12 → 111,12 |
found: |
/* |
* We found the device that functions as an interrupt controller |
* for the interrupt. We also found mapping from interrupt to INO. |
* for the interrupt. We also found mapping from interrupt to INR. |
*/ |
controller = ofw_tree_find_node_by_handle(ofw_tree_lookup("/"), intr_map[i].controller_handle); |
*ino = intr_map[i].controller_ino; |
*inr = intr_map[i].controller_inr; |
return true; |
} |
/trunk/kernel/genarch/src/ofw/fhc.c |
---|
109,7 → 109,7 |
return false; |
} |
bool ofw_fhc_map_interrupts(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *ino) |
bool ofw_fhc_map_interrupts(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *inr) |
{ |
fhc_t *fhc = NULL; |
if (!node->device) { |
125,7 → 125,7 |
*/ |
fhc_enable_interrupt(fhc, interrupt); |
*ino = interrupt; |
*inr = interrupt; |
return true; |
} |
/trunk/kernel/arch/sparc64/include/drivers/fhc.h |
---|
45,8 → 45,8 |
extern fhc_t *central_fhc; |
extern fhc_t *fhc_init(ofw_tree_node_t *node); |
extern void fhc_enable_interrupt(fhc_t *fhc, int ino); |
extern void fhc_clear_interrupt(fhc_t *fhc, int ino); |
extern void fhc_enable_interrupt(fhc_t *fhc, int inr); |
extern void fhc_clear_interrupt(fhc_t *fhc, int inr); |
#endif |
/trunk/kernel/arch/sparc64/src/drivers/fhc.c |
---|
54,7 → 54,7 |
* If it is not, than we can read all IMAP registers |
* and get the complete mapping. |
*/ |
#define FHC_UART_INO 0x39 |
#define FHC_UART_INR 0x39 |
#define FHC_UART_IMAP 0x0 |
#define FHC_UART_ICLR 0x4 |
90,29 → 90,29 |
return fhc; |
} |
void fhc_enable_interrupt(fhc_t *fhc, int ino) |
void fhc_enable_interrupt(fhc_t *fhc, int inr) |
{ |
switch (ino) { |
case FHC_UART_INO: |
switch (inr) { |
case FHC_UART_INR: |
fhc->uart_imap[FHC_UART_ICLR] = 0x0; |
fhc->uart_imap[FHC_UART_IMAP] = 0x80000000; |
break; |
default: |
panic("Unexpected INO (%d)\n", ino); |
panic("Unexpected INR (%d)\n", inr); |
break; |
} |
} |
void fhc_clear_interrupt(fhc_t *fhc, int ino) |
void fhc_clear_interrupt(fhc_t *fhc, int inr) |
{ |
ASSERT(fhc->uart_imap); |
switch (ino) { |
case FHC_UART_INO: |
switch (inr) { |
case FHC_UART_INR: |
fhc->uart_imap[FHC_UART_ICLR] = 0; |
break; |
default: |
panic("Unexpected INO (%d)\n", ino); |
panic("Unexpected INR (%d)\n", inr); |
break; |
} |
} |