Commit cb2013e7 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Implement RtlVirtualUnwind for ARM64EC.

parent 3b85ab31
......@@ -84,6 +84,11 @@ extern void WINAPI KiUserCallbackDispatcher(ULONG,void*,ULONG);
extern void WINAPI KiUserCallbackDispatcherReturn(void);
extern void (WINAPI *pWow64PrepareForException)( EXCEPTION_RECORD *rec, CONTEXT *context );
#ifdef __arm64ec__
extern void context_x64_to_arm( ARM64_NT_CONTEXT *arm_ctx, const CONTEXT *ctx );
extern void context_arm_to_x64( CONTEXT *ctx, const ARM64_NT_CONTEXT *arm_ctx );
#endif
/* debug helpers */
extern LPCSTR debugstr_us( const UNICODE_STRING *str );
extern const char *debugstr_exception_code( DWORD code );
......
......@@ -130,7 +130,7 @@ static UINT fpcsr_to_mxcsr( UINT fpcr, UINT fpsr )
return ret;
}
static void context_x64_to_arm( ARM64_NT_CONTEXT *arm_ctx, const CONTEXT *ctx )
void context_x64_to_arm( ARM64_NT_CONTEXT *arm_ctx, const CONTEXT *ctx )
{
ARM64EC_NT_CONTEXT *ec_ctx = (ARM64EC_NT_CONTEXT *)ctx;
UINT64 fpcsr;
......@@ -177,7 +177,7 @@ static void context_x64_to_arm( ARM64_NT_CONTEXT *arm_ctx, const CONTEXT *ctx )
arm_ctx->Fpsr = fpcsr >> 32;
}
static void context_arm_to_x64( CONTEXT *ctx, const ARM64_NT_CONTEXT *arm_ctx )
void context_arm_to_x64( CONTEXT *ctx, const ARM64_NT_CONTEXT *arm_ctx )
{
ARM64EC_NT_CONTEXT *ec_ctx = (ARM64EC_NT_CONTEXT *)ctx;
......@@ -1769,19 +1769,6 @@ void CDECL RtlRestoreContext( CONTEXT *context, EXCEPTION_RECORD *rec )
}
/**********************************************************************
* RtlVirtualUnwind (NTDLL.@)
*/
PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG64 base, ULONG64 pc,
RUNTIME_FUNCTION *function, CONTEXT *context,
PVOID *data, ULONG64 *frame_ret,
KNONVOLATILE_CONTEXT_POINTERS *ctx_ptr )
{
FIXME( "not implemented\n" );
return NULL;
}
/*******************************************************************
* RtlUnwindEx (NTDLL.@)
*/
......
......@@ -1751,6 +1751,20 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG64 base, ULONG64 pc,
unsigned int i, prolog_offset;
BOOL mach_frame = FALSE;
#ifdef __arm64ec__
if (RtlIsEcCode( (void *)pc ))
{
ARM64_NT_CONTEXT arm_context;
void *ret;
context_x64_to_arm( &arm_context, context );
ret = RtlVirtualUnwind_arm64( type, base, pc, (ARM64_RUNTIME_FUNCTION *)function,
&arm_context, data, frame_ret, NULL );
context_arm_to_x64( context, &arm_context );
return ret;
}
#endif
TRACE( "type %lx rip %I64x rsp %I64x\n", type, pc, context->Rsp );
if (TRACE_ON(unwind)) dump_unwind_info( base, function );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment