Ignore:
Timestamp:
Jul 19, 2017, 2:57:03 PM (5 years ago)
Author:
max@…
Message:

Attach the secondary CPUs, and for now route the keyboard irq to
cpu1 - test only, but nice.

File:
1 edited

Legend:

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

    r236 r237  
    5050void cpu_tls_init(size_t lid);
    5151void cpu_identify();
    52 void cpu_attach();
     52void cpu_attach(size_t lid);
    5353
    5454size_t mytest __in_kdata = 0;
     
    303303void init_x86_64_cpuN()
    304304{
     305        lid_t lid = hal_lapic_gid();
     306
     307        cpu_attach(lid);
     308        x86_printf("[cpu%z] cpu_attach called\n", (uint64_t)lid);
     309
     310        cpu_tls_init(lid);
     311        x86_printf("[cpu%z] cput_tls_init called\n", (uint64_t)lid);
     312
     313        cpu_lapic_init();
     314        x86_printf("[cpu%z] cpu_lapic_init called\n", (uint64_t)lid);
     315
    305316        cpuN_booted = 1;
    306         x86_printf("-> cpu%z is alive!\n", hal_lapic_gid());
     317
     318        if (lid == 1) {
     319                hal_ioapic_disable_irq(IRQ_KEYBOARD);
     320                hal_ioapic_bind_irq(IRQ_KEYBOARD, IOAPIC_KEYBOARD_VECTOR, 1);
     321                hal_ioapic_enable_irq(IRQ_KEYBOARD);
     322        }
     323
     324        sti();
    307325        while (1);
    308326}
     
    360378
    361379        hal_apic_init();
     380        cpu_lapic_init();
    362381        x86_printf("[+] hal_apic_init called\n");
    363382
Note: See TracChangeset for help on using the changeset viewer.