Changeset 203 for trunk/hal/x86_64/drivers/soclib_xcu.c
- Timestamp:
- Jul 13, 2017, 3:24:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/drivers/soclib_xcu.c
r139 r203 29 29 #include <hal_internal.h> 30 30 31 extern size_t ioapic_pins;32 33 /*34 * These indexes are used to translate a type::idx to a pin on the IOAPIC.35 */36 uint32_t hwi_baseidx __in_kdata = 0;37 uint32_t wti_baseidx __in_kdata = 0;38 uint32_t pti_baseidx __in_kdata = 0;39 40 static uint32_t get_pin(uint32_t idx, uint32_t type)41 {42 switch (type) {43 case HWI_TYPE:44 return hwi_baseidx + idx;45 case WTI_TYPE:46 return wti_baseidx + idx;47 case PTI_TYPE:48 return pti_baseidx + idx;49 default:50 x86_panic("get_pin: wrong type");51 return 0;52 }53 }54 31 55 32 void soclib_xcu_init(chdev_t *icu, lid_t lid) 56 33 { 57 size_t i;58 59 /* disable all IRQs */60 for (i = 0; i < ioapic_pins; i++) {61 hal_ioapic_disable_entry(i);62 }63 64 34 x86_panic((char *)__func__); 65 35 } … … 68 38 lid_t lid) 69 39 { 70 uint8_t dest = (uint8_t)lid; /* XXX */71 uint32_t pin;72 uint8_t vec;73 74 pin = get_pin(idx, type);75 76 switch (type) {77 case HWI_TYPE:78 vec = VECTOR_APIC_XCU_HWI;79 break;80 case WTI_TYPE:81 vec = VECTOR_APIC_XCU_WTI;82 break;83 case PTI_TYPE:84 vec = VECTOR_APIC_XCU_PTI;85 break;86 default:87 x86_panic("enabling wrong irq");88 }89 90 hal_ioapic_set_entry(pin, vec, dest);91 92 40 x86_panic((char *)__func__); 93 41 } … … 96 44 lid_t lid) 97 45 { 98 uint32_t pin = get_pin(idx, type);99 100 hal_ioapic_disable_entry(pin);101 102 46 x86_panic((char *)__func__); 103 47 }
Note: See TracChangeset
for help on using the changeset viewer.