ptos/amd64: Add task state segment
Signed-off-by: Chloe M <chloe@mensia.org>
This commit is contained in:
@@ -12,6 +12,10 @@
|
||||
#include <machine/trap.h>
|
||||
#include <machine/msr.h>
|
||||
#include <machine/lapic.h>
|
||||
#include <machine/gdt.h>
|
||||
|
||||
/* Externs */
|
||||
extern GDT_ENTRY g_GDT[GDT_ENTRY_COUNT];
|
||||
|
||||
/*
|
||||
* Initialize interrupts for the current processor
|
||||
@@ -66,9 +70,22 @@ HalKpcrP1Init(KPCR *Kpcr)
|
||||
VOID
|
||||
HalKpcrP2Init(KPCR *Kpcr)
|
||||
{
|
||||
TSS_DESCRIPTOR *TssDesc;
|
||||
|
||||
/* Initialize per-processor pools */
|
||||
ExPoolRegionInit(&Kpcr->PoolRegion);
|
||||
|
||||
/* Initialize the Local APIC unit */
|
||||
MdLapicInit(Kpcr);
|
||||
|
||||
/* Load the Task State Segment */
|
||||
TssDesc = (TSS_DESCRIPTOR *)&g_GDT[GDT_TSS_INDEX];
|
||||
MdTssInit(TssDesc);
|
||||
ASMV(
|
||||
"mov %0, %%ax\n"
|
||||
"ltr %%ax\n"
|
||||
:
|
||||
: "i" (GDT_TSS)
|
||||
: "memory"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user