Changeset 237
- Timestamp:
- Jul 19, 2017, 2:57:03 PM (7 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_apic.c
r236 r237 425 425 * Only the Spurious and APIC Timer interrupts are enabled. 426 426 */ 427 static void hal_lapic_init()427 void cpu_lapic_init() 428 428 { 429 429 if ((rdmsr(MSR_APICBASE) & APICBASE_PHYSADDR) != lapic_pa) { … … 524 524 hal_pic_init(); 525 525 526 /* Enable the LAPIC */527 hal_lapic_init();528 529 526 /* Enable the IOAPIC */ 530 527 hal_ioapic_init(); -
trunk/hal/x86_64/core/hal_apic.h
r236 r237 33 33 34 34 uint32_t hal_lapic_gid(); 35 void cpu_lapic_init(); 35 36 void hal_apic_init(); 36 37 -
trunk/hal/x86_64/core/hal_init.c
r236 r237 50 50 void cpu_tls_init(size_t lid); 51 51 void cpu_identify(); 52 void cpu_attach( );52 void cpu_attach(size_t lid); 53 53 54 54 size_t mytest __in_kdata = 0; … … 303 303 void init_x86_64_cpuN() 304 304 { 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 305 316 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(); 307 325 while (1); 308 326 } … … 360 378 361 379 hal_apic_init(); 380 cpu_lapic_init(); 362 381 x86_printf("[+] hal_apic_init called\n"); 363 382 -
trunk/hal/x86_64/core/hal_interrupt.c
r234 r237 38 38 void hal_timer_intr(hal_cpu_context_t *tf) 39 39 { 40 x86_printf("-> got timer: rip=%Z (th=%Z)\n", tf->tf_rip, 41 hal_get_current_thread()); 40 if (hal_get_gid() != 0) { 41 /* print the message only for cpu0 */ 42 return; 43 } 44 x86_printf("-> got timer: cpu%z rip=%Z (th=%Z)\n", hal_get_gid(), 45 tf->tf_rip, hal_get_current_thread()); 42 46 return; 43 47 } … … 132 136 val = in8(PS2_DATA); 133 137 134 x86_printf("-> got keyboard: rip=%Z key=%c ", tf->tf_rip, scancode_US[val]); 138 x86_printf("-> got keyboard: cpu%z rip=%Z key=%c ", hal_get_gid(), 139 tf->tf_rip, scancode_US[val]); 135 140 136 141 if (val & 0x80)
Note: See TracChangeset
for help on using the changeset viewer.