Implement ArSetGdtEntryBase() routine
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
9f311db9fc
commit
dfae0b4727
|
@ -73,6 +73,40 @@ ArInitializeProcessor(VOID)
|
|||
ArpIdentifyProcessor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing AMD64 GDT entry with new base address.
|
||||
*
|
||||
* @param Gdt
|
||||
* Supplies a pointer to the GDT.
|
||||
*
|
||||
* @param Selector
|
||||
* Specifies a segment selector of the GDT entry.
|
||||
*
|
||||
* @param Base
|
||||
* Specifies a base address value of the descriptor.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
ArSetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||
IN USHORT Selector,
|
||||
IN ULONG_PTR Base)
|
||||
{
|
||||
PKGDTENTRY GdtEntry;
|
||||
|
||||
/* Get GDT entry */
|
||||
GdtEntry = (PKGDTENTRY)((ULONG_PTR)Gdt + (Selector & ~RPL_MASK));
|
||||
|
||||
/* Set new GDT descriptor base */
|
||||
GdtEntry->BaseLow = (Base & 0xFFFF);
|
||||
GdtEntry->Bytes.BaseMiddle = ((Base >> 16) & 0xFF);
|
||||
GdtEntry->Bytes.BaseHigh = ((Base >> 24) & 0xFF);
|
||||
GdtEntry->BaseUpper = (Base >> 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifies processor type (vendor, model, stepping) as well as looks for available CPU features and stores them
|
||||
* in Processor Control Block (PRCB).
|
||||
|
@ -450,14 +484,14 @@ ArpSetGdtEntry(IN PKGDTENTRY Gdt,
|
|||
GdtEntry = (PKGDTENTRY)((ULONG_PTR)Gdt + (Selector & ~RPL_MASK));
|
||||
|
||||
/* Set GDT descriptor base */
|
||||
GdtEntry->BaseLow = Base & 0xFFFF;
|
||||
GdtEntry->Bytes.BaseMiddle = (Base >> 16) & 0xFF;
|
||||
GdtEntry->Bytes.BaseHigh = (Base >> 24) & 0xFF;
|
||||
GdtEntry->BaseUpper = Base >> 32;
|
||||
GdtEntry->BaseLow = (Base & 0xFFFF);
|
||||
GdtEntry->Bytes.BaseMiddle = ((Base >> 16) & 0xFF);
|
||||
GdtEntry->Bytes.BaseHigh = ((Base >> 24) & 0xFF);
|
||||
GdtEntry->BaseUpper = (Base >> 32);
|
||||
|
||||
/* Set descriptor limit */
|
||||
GdtEntry->LimitLow = Limit & 0xFFFF;
|
||||
GdtEntry->Bits.LimitHigh = (Limit >> 16) & 0xF;
|
||||
GdtEntry->LimitLow = (Limit & 0xFFFF);
|
||||
GdtEntry->Bits.LimitHigh = ((Limit >> 16) & 0xF);
|
||||
|
||||
/* Initialize GDT entry */
|
||||
GdtEntry->Bits.DefaultBig = !!(SegmentMode & 2);
|
||||
|
|
|
@ -71,6 +71,39 @@ ArInitializeProcessor(VOID)
|
|||
ArpIdentifyProcessor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing i686 GDT entry with new base address.
|
||||
*
|
||||
* @param Gdt
|
||||
* Supplies a pointer to the GDT.
|
||||
*
|
||||
* @param Selector
|
||||
* Specifies a segment selector of the GDT entry.
|
||||
*
|
||||
* @param Base
|
||||
* Specifies a base address value of the descriptor.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
ArSetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||
IN USHORT Selector,
|
||||
IN ULONG_PTR Base)
|
||||
{
|
||||
PKGDTENTRY GdtEntry;
|
||||
|
||||
/* Get GDT entry */
|
||||
GdtEntry = (PKGDTENTRY)((ULONG_PTR)Gdt + (Selector & ~RPL_MASK));
|
||||
|
||||
/* Set new GDT descriptor base */
|
||||
GdtEntry->BaseLow = (Base & 0xFFFF);
|
||||
GdtEntry->Bytes.BaseMiddle = ((Base >> 16) & 0xFF);
|
||||
GdtEntry->Bytes.BaseHigh = ((Base >> 24) & 0xFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifies processor type (vendor, model, stepping) as well as looks for available CPU features and stores them
|
||||
* in Processor Control Block (PRCB).
|
||||
|
@ -416,7 +449,7 @@ ArpSetDoubleFaultTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
|||
}
|
||||
|
||||
/**
|
||||
* Fills in an AMD64 GDT entry.
|
||||
* Fills in an i686 GDT entry.
|
||||
*
|
||||
* @param Gdt
|
||||
* Supplies a pointer to the GDT.
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
#include <xtos.h>
|
||||
|
||||
|
||||
XTAPI
|
||||
VOID
|
||||
ArSetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||
IN USHORT Selector,
|
||||
IN ULONG_PTR Base);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
ArpHandleSystemCall32();
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
#include <xtos.h>
|
||||
|
||||
|
||||
XTAPI
|
||||
VOID
|
||||
ArSetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||
IN USHORT Selector,
|
||||
IN ULONG_PTR Base);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
ArpHandleTrap00();
|
||||
|
|
Loading…
Reference in New Issue
Block a user