Changeset 168 for trunk/hal/x86_64/core/hal_init.c
- Timestamp:
- Jul 10, 2017, 10:33:15 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r166 r168 48 48 static void gdt_create(); 49 49 static void idt_create(); 50 void cpu_tls_init(size_t lid); 50 51 void cpu_identify(); 51 52 void cpu_attach(); … … 292 293 x86_printf("[+] hal_apic_init called\n"); 293 294 294 hal_tls_init_cpu0();295 x86_printf("[+] hal_tls_init_cpu0called\n");295 cpu_tls_init(0); 296 x86_printf("[+] cput_tls_init called\n"); 296 297 297 298 x86_printf("-> mytest = %z\n", mytest); … … 328 329 typedef struct { 329 330 struct tss tss; 331 struct tls tls; 330 332 uint8_t intr_stack[STKSIZE]; 331 333 uint8_t dbfl_stack[STKSIZE]; … … 485 487 /* -------------------------------------------------------------------------- */ 486 488 489 void cpu_tls_init(size_t lid) 490 { 491 percpu_archdata_t *data = &cpudata[lid]; 492 tls_t *cputls = &data->tls; 493 494 memset(cputls, 0, sizeof(tls_t)); 495 496 cputls->tls_self = cputls; 497 cputls->tls_gid = hal_lapic_gid(); 498 cputls->tls_lid = lid; 499 500 wrmsr(MSR_FSBASE, 0); 501 wrmsr(MSR_GSBASE, (uint64_t)cputls); 502 wrmsr(MSR_KERNELGSBASE, 0); 503 } 504 505 /* -------------------------------------------------------------------------- */ 506 487 507 uint64_t cpu_features[4] __in_kdata; 488 508 … … 532 552 void cpu_attach(size_t lid) 533 553 { 554 /* Per-cluster structures */ 534 555 cpu_load_gdt(); 535 556 cpu_load_idt(); 557 558 /* Per-cpu structures */ 536 559 cpu_create_tss(lid); 537 560
Note: See TracChangeset
for help on using the changeset viewer.