Changeset 165
- Timestamp:
- Jul 10, 2017, 9:13:04 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r164 r165 313 313 /* -------------------------------------------------------------------------- */ 314 314 315 /* x86-specific per-cluster structures */ 315 316 uint8_t gdtstore[PAGE_SIZE] __in_kdata; 316 317 uint8_t idtstore[PAGE_SIZE] __in_kdata; 317 struct tss cpu_tss[CONFIG_MAX_LOCAL_CORES] __in_kdata; 318 uint8_t cpu_intr_stack[CONFIG_MAX_LOCAL_CORES][STKSIZE] __in_kdata; 319 uint8_t cpu_dbfl_stack[CONFIG_MAX_LOCAL_CORES][STKSIZE] __in_kdata; 320 uint8_t cpu_nmfl_stack[CONFIG_MAX_LOCAL_CORES][STKSIZE] __in_kdata; 318 319 /* x86-specific per-cpu structures */ 320 typedef struct { 321 struct tss tss; 322 uint8_t intr_stack[STKSIZE]; 323 uint8_t dbfl_stack[STKSIZE]; 324 uint8_t nmfl_stack[STKSIZE]; 325 } percpu_archdata_t; 326 percpu_archdata_t cpudata[CONFIG_MAX_LOCAL_CORES] __in_kdata; 321 327 322 328 static void … … 437 443 /* -------------------------------------------------------------------------- */ 438 444 439 /*440 * The gdt bitmap must be per-cluster.441 */442 445 int tss_alloc(struct tss *tss, size_t lid) 443 446 { 444 447 int slot; 445 448 446 /* Once we have proper SMP support, we will change that */447 449 slot = GDT_CPUTSS_SEL + lid; 448 450 … … 455 457 void cpu_create_tss(size_t lid) 456 458 { 457 struct tss *tss = &cpu_tss[lid]; 459 percpu_archdata_t *data = &cpudata[lid]; 460 struct tss *tss = &data->tss; 458 461 int sel; 459 462 … … 462 465 463 466 /* tss->tss_rsp0 */ 464 tss->tss_ist[0] = (uint64_t) cpu_intr_stack[lid] + STKSIZE;465 tss->tss_ist[1] = (uint64_t) cpu_dbfl_stack[lid] + STKSIZE;466 tss->tss_ist[2] = (uint64_t) cpu_nmfl_stack[lid] + STKSIZE;467 tss->tss_ist[0] = (uint64_t)data->intr_stack[lid] + STKSIZE; 468 tss->tss_ist[1] = (uint64_t)data->dbfl_stack[lid] + STKSIZE; 469 tss->tss_ist[2] = (uint64_t)data->nmfl_stack[lid] + STKSIZE; 467 470 tss->tss_iobase = IOMAP_INVALOFF << 16; 468 471 sel = tss_alloc(tss, lid);
Note: See TracChangeset
for help on using the changeset viewer.