mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 06:00:41 +02:00
FEXCore: Split GDT and LDT prep work
Taking this very slowly because this is very fickle code. The frontend needs to manage GDT and LDT, but before we get there, we need to actually add support for LDT in the backend. Split the segments to two arrays so the JIT can actually update their cached values correctly. Still treats GDT and LDT as mirrors like how the JIT previously did (By it ignoring the selector's TI bit).
This commit is contained in:
8 files changed
+72
-42
No files matched your search
@@ -382,8 +382,9 @@ static void LoadStateFromECContext(FEXCore::Core::InternalThreadState* Thread, C
|
||||
|
||||
// The TEB is the only populated GDT entry by default
|
||||
const auto TEB = reinterpret_cast<uint64_t>(NtCurrentTeb());
|
||||
State.SetGDTBase(&State.gdt[(Context.SegGs & 0xffff) >> 3], TEB);
|
||||
State.SetGDTLimit(&State.gdt[(Context.SegGs & 0xffff) >> 3], 0xF'FFFFU);
|
||||
auto GDT = State.GetSegmentFromIndex(State, (Context.SegGs & 0xffff));
|
||||
State.SetGDTBase(GDT, TEB);
|
||||
State.SetGDTLimit(GDT, 0xF'FFFFU);
|
||||
State.gs_cached = TEB;
|
||||
State.fs_cached = 0;
|
||||
State.es_cached = 0;
|
||||
|
||||
Reference in new issue
Block a user