The context address can be found in X0 when this is called, that is unlikely to be a coincidence.
From: Billy Laws blaws05@gmail.com
The context address can be found in X0 when this is called, that is unlikely to be a coincidence. --- dlls/ntdll/signal_arm64ec.c | 7 ++++--- dlls/xtajit64/cpu.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index e44ac9fc467..2285c62f94e 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -44,7 +44,7 @@ static void (WINAPI *pBTCpu64FlushInstructionCache)(const void*,SIZE_T); static BOOLEAN (WINAPI *pBTCpu64IsProcessorFeaturePresent)(UINT); static void (WINAPI *pBTCpu64NotifyMemoryDirty)(void*,SIZE_T); static void (WINAPI *pBTCpu64NotifyReadFile)(HANDLE,void*,SIZE_T,BOOL,NTSTATUS); -static void (WINAPI *pBeginSimulation)(void); +static void (WINAPI *pBeginSimulation)(CONTEXT*); static void (WINAPI *pFlushInstructionCacheHeavy)(const void*,SIZE_T); static NTSTATUS (WINAPI *pNotifyMapViewOfSection)(void*,void*,void*,SIZE_T,ULONG,ULONG); static void (WINAPI *pNotifyMemoryAlloc)(void*,SIZE_T,ULONG,ULONG,BOOL,NTSTATUS); @@ -1037,8 +1037,9 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context ) */ void dispatch_emulation( ARM64_NT_CONTEXT *arm_ctx ) { - context_arm_to_x64( get_arm64ec_cpu_area()->ContextAmd64, arm_ctx ); - pBeginSimulation(); + ARM64EC_NT_CONTEXT *context = get_arm64ec_cpu_area()->ContextAmd64; + context_arm_to_x64( context, arm_ctx ); + pBeginSimulation( &context->AMD64_Context ); } __ASM_GLOBAL_FUNC( "#KiUserEmulationDispatcher", ".seh_context\n\t" diff --git a/dlls/xtajit64/cpu.c b/dlls/xtajit64/cpu.c index fec5f233eec..1a88db24a75 100644 --- a/dlls/xtajit64/cpu.c +++ b/dlls/xtajit64/cpu.c @@ -70,8 +70,9 @@ void WINAPI ExitToX64(void) /********************************************************************** * BeginSimulation (xtajit64.@) */ -void WINAPI BeginSimulation(void) +void WINAPI BeginSimulation( CONTEXT *context ) { + TRACE( "%p\n", context ); ERR( "x64 emulation not implemented\n" ); NtTerminateProcess( GetCurrentProcess(), 1 ); }
I don't think we want to depend on that without stronger evidence that this is the correct signature. Native xtajit64 doesn't use x0, cf. 7d1c886548f4cd8ee7708e243001cc57bf9fec3a.
This merge request was closed by Billy Laws.