Changeset 162
- Timestamp:
- Jul 7, 2017, 2:39:34 PM (7 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r154 r162 264 264 265 265 /* Attach cpu0 */ 266 cpu_attach( );266 cpu_attach(0); 267 267 x86_printf("[+] cpu_attach called\n"); 268 268 … … 315 315 uint8_t gdtstore[PAGE_SIZE] __in_kdata; 316 316 uint8_t idtstore[PAGE_SIZE] __in_kdata; 317 struct tss cpu 0_tss__in_kdata;318 uint8_t cpu 0_intr_stack[STKSIZE] __in_kdata;319 uint8_t cpu 0_dbfl_stack[STKSIZE] __in_kdata;320 uint8_t cpu 0_nmfl_stack[STKSIZE] __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; 321 321 322 322 static void … … 453 453 } 454 454 455 void cpu_create_tss( )456 { 457 struct tss *tss = &cpu 0_tss;455 void cpu_create_tss(size_t lid) 456 { 457 struct tss *tss = &cpu_tss[lid]; 458 458 int sel; 459 459 460 460 /* Create the tss */ 461 461 memset(tss, 0, sizeof(*tss)); 462 463 /* 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; 462 467 tss->tss_iobase = IOMAP_INVALOFF << 16; 463 tss->tss_ist[0] = (uint64_t)cpu0_intr_stack + STKSIZE;464 tss->tss_ist[1] = (uint64_t)cpu0_dbfl_stack + STKSIZE;465 tss->tss_ist[2] = (uint64_t)cpu0_nmfl_stack + STKSIZE;466 468 sel = tss_alloc(tss); 467 469 … … 472 474 /* -------------------------------------------------------------------------- */ 473 475 474 void cpu_attach( )476 void cpu_attach(size_t lid) 475 477 { 476 478 cpu_load_gdt(); 477 479 cpu_load_idt(); 478 cpu_create_tss( );479 } 480 480 cpu_create_tss(lid); 481 } 482 -
trunk/hal/x86_64/core/hal_segmentation.h
r152 r162 133 133 struct tss { 134 134 uint32_t tss_reserved1; 135 uint64_t tss_rsp0; 136 uint64_t tss_rsp1; 137 uint64_t tss_rsp 3;135 uint64_t tss_rsp0; /* kernel stack pointer ring 0 */ 136 uint64_t tss_rsp1; /* kernel stack pointer ring 1 */ 137 uint64_t tss_rsp2; /* kernel stack pointer ring 2 */ 138 138 uint32_t tss_reserved2; 139 139 uint32_t tss_reserved3; 140 uint64_t tss_ist[7]; 140 uint64_t tss_ist[7]; /* Interrupt stack table */ 141 141 uint32_t tss_reserved4; 142 142 uint32_t tss_reserved5;
Note: See TracChangeset
for help on using the changeset viewer.