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();
|
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
|
* Identifies processor type (vendor, model, stepping) as well as looks for available CPU features and stores them
|
||||||
* in Processor Control Block (PRCB).
|
* in Processor Control Block (PRCB).
|
||||||
@ -450,14 +484,14 @@ ArpSetGdtEntry(IN PKGDTENTRY Gdt,
|
|||||||
GdtEntry = (PKGDTENTRY)((ULONG_PTR)Gdt + (Selector & ~RPL_MASK));
|
GdtEntry = (PKGDTENTRY)((ULONG_PTR)Gdt + (Selector & ~RPL_MASK));
|
||||||
|
|
||||||
/* Set GDT descriptor base */
|
/* Set GDT descriptor base */
|
||||||
GdtEntry->BaseLow = Base & 0xFFFF;
|
GdtEntry->BaseLow = (Base & 0xFFFF);
|
||||||
GdtEntry->Bytes.BaseMiddle = (Base >> 16) & 0xFF;
|
GdtEntry->Bytes.BaseMiddle = ((Base >> 16) & 0xFF);
|
||||||
GdtEntry->Bytes.BaseHigh = (Base >> 24) & 0xFF;
|
GdtEntry->Bytes.BaseHigh = ((Base >> 24) & 0xFF);
|
||||||
GdtEntry->BaseUpper = Base >> 32;
|
GdtEntry->BaseUpper = (Base >> 32);
|
||||||
|
|
||||||
/* Set descriptor limit */
|
/* Set descriptor limit */
|
||||||
GdtEntry->LimitLow = Limit & 0xFFFF;
|
GdtEntry->LimitLow = (Limit & 0xFFFF);
|
||||||
GdtEntry->Bits.LimitHigh = (Limit >> 16) & 0xF;
|
GdtEntry->Bits.LimitHigh = ((Limit >> 16) & 0xF);
|
||||||
|
|
||||||
/* Initialize GDT entry */
|
/* Initialize GDT entry */
|
||||||
GdtEntry->Bits.DefaultBig = !!(SegmentMode & 2);
|
GdtEntry->Bits.DefaultBig = !!(SegmentMode & 2);
|
||||||
|
@ -71,6 +71,39 @@ ArInitializeProcessor(VOID)
|
|||||||
ArpIdentifyProcessor();
|
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
|
* Identifies processor type (vendor, model, stepping) as well as looks for available CPU features and stores them
|
||||||
* in Processor Control Block (PRCB).
|
* 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
|
* @param Gdt
|
||||||
* Supplies a pointer to the GDT.
|
* Supplies a pointer to the GDT.
|
||||||
|
@ -12,6 +12,12 @@
|
|||||||
#include <xtos.h>
|
#include <xtos.h>
|
||||||
|
|
||||||
|
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
ArSetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||||
|
IN USHORT Selector,
|
||||||
|
IN ULONG_PTR Base);
|
||||||
|
|
||||||
XTCDECL
|
XTCDECL
|
||||||
VOID
|
VOID
|
||||||
ArpHandleSystemCall32();
|
ArpHandleSystemCall32();
|
||||||
|
@ -12,6 +12,12 @@
|
|||||||
#include <xtos.h>
|
#include <xtos.h>
|
||||||
|
|
||||||
|
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
ArSetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||||
|
IN USHORT Selector,
|
||||||
|
IN ULONG_PTR Base);
|
||||||
|
|
||||||
XTCDECL
|
XTCDECL
|
||||||
VOID
|
VOID
|
||||||
ArpHandleTrap00();
|
ArpHandleTrap00();
|
||||||
|
Loading…
Reference in New Issue
Block a user