Ignore:
Timestamp:
Jul 3, 2017, 5:21:06 PM (5 years ago)
Author:
max@…
Message:

start moving the APIC into the XCU driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_apic.c

    r117 r135  
    114114/* -------------------------------------------------------------------------- */
    115115
     116size_t ioapic_pins __in_kdata = 0;
    116117paddr_t ioapic_pa __in_kdata = 0;
    117118vaddr_t ioapic_va __in_kdata = 0;
     
    133134#define IOREDTBL        0x10
    134135
    135 #define IOENTRY_DISABLE 0x10000
    136 
    137136void hal_ioapic_write(uint8_t reg, uint32_t val)
    138137{
     
    155154static void hal_ioapic_init()
    156155{
    157         size_t i, pins;
    158156        uint32_t ver;
     157        size_t i;
    159158
    160159        ioapic_va = hal_gpt_bootstrap_valloc(1); // XXX: should be shared
     
    163162
    164163        ver = hal_ioapic_read(IOAPICVER);
    165         pins = ((ver >> 16) & 0xFF) + 1;
     164        ioapic_pins = ((ver >> 16) & 0xFF) + 1;
    166165
    167166        /* Explicitly disable (mask) each vector */
    168         for (i = 0; i < pins; i++) {
     167        for (i = 0; i < ioapic_pins; i++) {
    169168                hal_ioapic_set_entry(i, IOENTRY_DISABLE);
    170169        }
     170
     171        x86_printf("IOAPICPINS: #%z\n", ioapic_pins);
    171172
    172173        /* Now, enable the keyboard */
     
    205206        /* Initialize the LAPIC timer to the maximum value */
    206207        hal_lapic_write(LAPIC_ICR_TIMER, 0xFFFFFFFF);
     208
     209        /* Initialize the PIT */
     210        hal_pit_init();
    207211
    208212        pittick = hal_pit_timer_read() + 1;
     
    239243 *  - APIC internal error (ERR)
    240244 *  - Extended (Implementation dependent)
     245 * Only the Spurious and APIC Timer interrupts are enabled.
    241246 */
    242247static void hal_lapic_init()
Note: See TracChangeset for help on using the changeset viewer.