Changeset 135 for trunk/hal/x86_64/core/hal_apic.c
- Timestamp:
- Jul 3, 2017, 5:21:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_apic.c
r117 r135 114 114 /* -------------------------------------------------------------------------- */ 115 115 116 size_t ioapic_pins __in_kdata = 0; 116 117 paddr_t ioapic_pa __in_kdata = 0; 117 118 vaddr_t ioapic_va __in_kdata = 0; … … 133 134 #define IOREDTBL 0x10 134 135 135 #define IOENTRY_DISABLE 0x10000136 137 136 void hal_ioapic_write(uint8_t reg, uint32_t val) 138 137 { … … 155 154 static void hal_ioapic_init() 156 155 { 157 size_t i, pins;158 156 uint32_t ver; 157 size_t i; 159 158 160 159 ioapic_va = hal_gpt_bootstrap_valloc(1); // XXX: should be shared … … 163 162 164 163 ver = hal_ioapic_read(IOAPICVER); 165 pins = ((ver >> 16) & 0xFF) + 1;164 ioapic_pins = ((ver >> 16) & 0xFF) + 1; 166 165 167 166 /* Explicitly disable (mask) each vector */ 168 for (i = 0; i < pins; i++) {167 for (i = 0; i < ioapic_pins; i++) { 169 168 hal_ioapic_set_entry(i, IOENTRY_DISABLE); 170 169 } 170 171 x86_printf("IOAPICPINS: #%z\n", ioapic_pins); 171 172 172 173 /* Now, enable the keyboard */ … … 205 206 /* Initialize the LAPIC timer to the maximum value */ 206 207 hal_lapic_write(LAPIC_ICR_TIMER, 0xFFFFFFFF); 208 209 /* Initialize the PIT */ 210 hal_pit_init(); 207 211 208 212 pittick = hal_pit_timer_read() + 1; … … 239 243 * - APIC internal error (ERR) 240 244 * - Extended (Implementation dependent) 245 * Only the Spurious and APIC Timer interrupts are enabled. 241 246 */ 242 247 static void hal_lapic_init()
Note: See TracChangeset
for help on using the changeset viewer.