From 2a8f4dbbb64da75188adbd57e64e753154aaf4fb Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 25 Jul 2025 14:07:08 -0700 Subject: [PATCH] Arm64EC: Update for GDT --- Source/Windows/ARM64EC/Module.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Windows/ARM64EC/Module.cpp b/Source/Windows/ARM64EC/Module.cpp index 388597c85..88cab9773 100644 --- a/Source/Windows/ARM64EC/Module.cpp +++ b/Source/Windows/ARM64EC/Module.cpp @@ -378,7 +378,8 @@ static void LoadStateFromECContext(FEXCore::Core::InternalThreadState* Thread, C // The TEB is the only populated GDT entry by default const auto TEB = reinterpret_cast(NtCurrentTeb()); - State.gdt[(Context.SegGs & 0xffff) >> 3].base = TEB; + State.SetGDTBase(&State.gdt[(Context.SegGs & 0xffff) >> 3], TEB); + State.SetGDTLimit(&State.gdt[(Context.SegGs & 0xffff) >> 3], 0xF'FFFFU); State.gs_cached = TEB; State.fs_cached = 0; State.es_cached = 0;