Changeset 33b1903 in mainline
- Timestamp:
- 2006-10-07T11:24:19Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d4a577
- Parents:
- e2cc9a0
- Location:
- kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/drivers/kbd.c
re2cc9a0 r33b1903 109 109 return; 110 110 } 111 if (!ofw_fhc_map_interrupt s(node->parent, ((ofw_fhc_reg_t *) prop->value), interrupts, &inr)) {112 printf("Failed to determine keyboard interrupt s.\n");111 if (!ofw_fhc_map_interrupt(node->parent, ((ofw_fhc_reg_t *) prop->value), interrupts, &inr)) { 112 printf("Failed to determine keyboard interrupt.\n"); 113 113 return; 114 114 } … … 120 120 return; 121 121 } 122 if (!ofw_ebus_map_interrupt s(node->parent, ((ofw_ebus_reg_t *) prop->value), interrupts, &inr)) {123 printf("Failed to determine keyboard interrupt s.\n");122 if (!ofw_ebus_map_interrupt(node->parent, ((ofw_ebus_reg_t *) prop->value), interrupts, &inr)) { 123 printf("Failed to determine keyboard interrupt.\n"); 124 124 return; 125 125 } -
kernel/genarch/include/ofw/ofw_tree.h
re2cc9a0 r33b1903 116 116 uint32_t intr; 117 117 uint32_t controller_handle; 118 uint32_t controller_in r;118 uint32_t controller_ino; 119 119 } __attribute__ ((packed)); 120 120 typedef struct ofw_ebus_intr_map ofw_ebus_intr_map_t; … … 166 166 extern bool ofw_pci_reg_absolutize(ofw_tree_node_t *node, ofw_pci_reg_t *reg, ofw_pci_reg_t *out); 167 167 168 extern bool ofw_fhc_map_interrupts(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *inr); 169 extern bool ofw_ebus_map_interrupts(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *inr); 168 extern bool ofw_fhc_map_interrupt(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *inr); 169 extern bool ofw_ebus_map_interrupt(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *inr); 170 extern bool ofw_pci_map_interrupt(ofw_tree_node_t *node, ofw_pci_reg_t *reg, int ino, int *inr); 170 171 171 172 #endif -
kernel/genarch/src/ofw/ebus.c
re2cc9a0 r33b1903 37 37 38 38 #include <genarch/ofw/ofw_tree.h> 39 #include <arch/drivers/pci.h>40 39 #include <arch/memstr.h> 41 40 #include <arch/trap/interrupt.h> … … 78 77 } 79 78 80 bool ofw_ebus_map_interrupt s(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *inr)79 bool ofw_ebus_map_interrupt(ofw_tree_node_t *node, ofw_ebus_reg_t *reg, uint32_t interrupt, int *inr) 81 80 { 82 81 ofw_tree_property_t *prop; … … 115 114 /* 116 115 * We found the device that functions as an interrupt controller 117 * for the interrupt. We also found mapping from interrupt to INR. 118 * What needs to be done now is to verify that this indeed is a PCI 119 * node. 116 * for the interrupt. We also found partial mapping from interrupt to INO. 120 117 */ 121 118 … … 131 128 } 132 129 133 pci_t *pci = controller->device; 134 if (!pci) { 135 pci = pci_init(controller); 136 if (!pci) 137 return false; 138 controller->device = pci; 139 140 } 141 pci_enable_interrupt(pci, intr_map[i].controller_inr); 130 /* 131 * Let the PCI do the next step in mapping the interrupt. 132 */ 133 if (!ofw_pci_map_interrupt(controller, NULL, intr_map[i].controller_ino, inr)) 134 return false; 142 135 143 *inr = intr_map[i].controller_inr;144 *inr |= 0x1f << IGN_SHIFT; /* 0x1f is hardwired IGN */145 146 136 return true; 147 137 } -
kernel/genarch/src/ofw/fhc.c
re2cc9a0 r33b1903 110 110 } 111 111 112 bool ofw_fhc_map_interrupt s(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *inr)112 bool ofw_fhc_map_interrupt(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uint32_t interrupt, int *inr) 113 113 { 114 114 fhc_t *fhc = NULL; -
kernel/genarch/src/ofw/pci.c
re2cc9a0 r33b1903 37 37 38 38 #include <genarch/ofw/ofw_tree.h> 39 #include <arch/drivers/pci.h> 40 #include <arch/trap/interrupt.h> 39 41 #include <arch/memstr.h> 40 42 #include <func.h> … … 45 47 #define PCI_ABS_MASK 0x80000000 46 48 #define PCI_REG_MASK 0x000000ff 49 50 #define PCI_IGN 0x1f 47 51 48 52 bool ofw_pci_apply_ranges(ofw_tree_node_t *node, ofw_pci_reg_t *reg, uintptr_t *pa) … … 111 115 } 112 116 117 /** Map PCI interrupt. 118 * 119 * So far, we only know how to map interrupts of non-PCI devices connected 120 * to a PCI bridge. 121 */ 122 bool ofw_pci_map_interrupt(ofw_tree_node_t *node, ofw_pci_reg_t *reg, int ino, int *inr) 123 { 124 pci_t *pci = node->device; 125 if (!pci) { 126 pci = pci_init(node); 127 if (!pci) 128 return false; 129 node->device = pci; 130 } 131 132 pci_enable_interrupt(pci, ino); 133 134 *inr = (PCI_IGN << IGN_SHIFT) | ino; 135 136 return true; 137 } 138 113 139 /** @} 114 140 */
Note:
See TracChangeset
for help on using the changeset viewer.