Fix KiInitGdtEntry

svn path=/branches/ros-amd64-bringup/; revision=39278
This commit is contained in:
Timo Kreuzer
2009-02-01 22:08:01 +00:00
parent 61f5b1e0b2
commit 3d3f2049c4
2 changed files with 5 additions and 2 deletions
@@ -286,7 +286,7 @@ FrLdrSetupGdtIdt()
/* Setup TSS entry */
Entry = KiGetGdtEntry(pGdt, KGDT_TSS);
KiInitGdtEntry(Entry, TssBase, I386_TSS, 0);
KiInitGdtEntry(Entry, TssBase, sizeof(KTSS), I386_TSS, 0);
/* Setup the gdt descriptor */
Desc.Limit = 12 * sizeof(ULONG64) - 1;
@@ -69,7 +69,7 @@ KiGetGdtEntry(PVOID pGdt, USHORT Index)
VOID
FORCEINLINE
KiInitGdtEntry(PKGDTENTRY64 Entry, ULONG64 Base, UCHAR Type, UCHAR Dpl)
KiInitGdtEntry(PKGDTENTRY64 Entry, ULONG64 Base, ULONG Limit, UCHAR Type, UCHAR Dpl)
{
Entry->Bits.Type = Type;
Entry->Bits.Present = 1;
@@ -78,6 +78,9 @@ KiInitGdtEntry(PKGDTENTRY64 Entry, ULONG64 Base, UCHAR Type, UCHAR Dpl)
Entry->Bytes.BaseMiddle = (UCHAR)(Base >> 16);
Entry->Bytes.BaseHigh = (UCHAR)(Base >> 24);
Entry->BaseUpper = (ULONG)(Base >> 32);
Entry->LimitLow = (USHORT)(Limit & 0xFFFF);
Entry->Bits.LimitHigh = (ULONG)((Limit >> 16) & 0xf);
Entry->MustBeZero = 0;
}
VOID FrLdrSetupGdtIdt();