Changeset 240 for trunk/hal/x86_64/core/hal_init.c
- Timestamp:
- Jul 20, 2017, 9:55:05 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r237 r240 58 58 uint8_t mb_mmap[PAGE_SIZE] __in_kdata; 59 59 60 size_t ncpu __in_kdata = 0; 61 static boot_info_t btinfo __in_kdata; 62 60 63 /* x86-specific per-cluster structures */ 61 64 uint8_t gdtstore[PAGE_SIZE] __in_kdata; … … 160 163 static void init_bootinfo_core(boot_core_t *core) 161 164 { 162 memset(core, 0, sizeof(boot_core_t)); 163 164 core->gid = hal_lapic_gid(); 165 core->lid = 0; 166 core->cxy = 0; 165 size_t i; 166 167 // XXX: not necessarily contiguous 168 for (i = 0; i < ncpu; i++) { 169 memset(&core[i], 0, sizeof(boot_core_t)); 170 171 core[i].gid = i; 172 core[i].lid = i; 173 core[i].cxy = 0; 174 } 167 175 } 168 176 … … 240 248 241 249 info->cxy = 0; 242 info->cores_nr = 1;243 init_bootinfo_core( &info->core[0]);250 info->cores_nr = ncpu; 251 init_bootinfo_core((boot_core_t *)&info->core); 244 252 245 253 info->rsvd_nr = init_bootinfo_rsvd((boot_rsvd_t *)&info->rsvd); … … 303 311 void init_x86_64_cpuN() 304 312 { 305 lid_t lid = hal_lapic_gid(); 313 lid_t lid; 314 315 cli(); 316 317 lid = hal_lapic_gid(); 306 318 307 319 cpu_attach(lid); … … 322 334 } 323 335 324 sti(); 336 kernel_init(&btinfo); 337 338 reg_t dummy; 339 hal_enable_irq(&dummy); 340 325 341 while (1); 326 342 } … … 342 358 void init_x86_64(paddr_t firstpa) 343 359 { 344 boot_info_t btinfo;360 cli(); 345 361 346 362 /* Initialize the serial port */ … … 396 412 start_secondary_cpus(); 397 413 414 kernel_init(&btinfo); 415 416 x86_printf("[+] kernel_init called\n"); 417 398 418 reg_t dummy; 399 419 hal_enable_irq(&dummy); 400 401 while (1);402 403 kernel_init(&btinfo);404 405 x86_printf("[+] kernel_init called\n");406 420 /* 407 421 void *ptr; … … 623 637 cputls->tls_gid = hal_lapic_gid(); 624 638 cputls->tls_lid = lid; 639 cputls->tls_intr = INTRS_DISABLED; 625 640 626 641 wrmsr(MSR_FSBASE, 0);
Note: See TracChangeset
for help on using the changeset viewer.