Commit 04a74bdb authored by Alexandre Julliard's avatar Alexandre Julliard

winebuild: Add SEH information to relay entry points on ARM64.

parent 425bd55b
......@@ -646,10 +646,11 @@ DECLSPEC_HIDDEN void WINAPI relay_trace_exit( struct relay_descr *descr, unsigne
extern LONGLONG CDECL call_entry_point( void *func, int nb_args, const INT_PTR *args );
__ASM_GLOBAL_FUNC( call_entry_point,
"stp x29, x30, [SP,#-16]!\n\t"
"stp x19, x20, [SP,#-16]!\n\t"
__ASM_SEH(".seh_save_fplr_x 16\n\t")
"mov x29, SP\n\t"
"mov x19, x2\n\t"
"ldp x8, x9, [x19, #-32]\n\t"
__ASM_SEH(".seh_set_fp\n\t")
__ASM_SEH(".seh_endprologue\n\t")
"ldr x8, [x2, #-32]\n\t"
"mov x9, x0\n\t"
"cbz w1, 2f\n\t"
"mov w10, w1\n\t"
......@@ -682,7 +683,6 @@ __ASM_GLOBAL_FUNC( call_entry_point,
"cbnz w12, 1b\n\t"
"2: blr x9\n\t"
"mov SP, x29\n\t"
"ldp x19, x20, [SP], #16\n\t"
"ldp x29, x30, [SP], #16\n\t"
"ret\n" )
......
......@@ -329,28 +329,30 @@ static void output_relay_debug( DLLSPEC *spec )
}
case CPU_ARM64:
{
int stack_size = 16 * ((min(odp->u.func.nb_args, 8) + 1) / 2);
output( "\t.align %d\n", get_alignment(4) );
output( "__wine_spec_relay_entry_point_%d:\n", i );
output_cfi( ".cfi_startproc" );
switch (odp->u.func.nb_args)
{
default:
case 8:
case 7: output( "\tstp x6, x7, [SP,#-16]!\n" );
output_cfi( ".seh_proc __wine_spec_relay_entry_point_%d", i );
output( "\tstp x29, x30, [sp, #-%u]!\n", stack_size + 16 );
output_cfi( ".seh_save_fplr_x %u", stack_size + 16 );
output( "\tmov x29, sp\n" );
output_cfi( ".seh_set_fp" );
output_cfi( ".seh_endprologue" );
switch (stack_size)
{
case 64: output( "\tstp x6, x7, [sp, #64]\n" );
/* fall through */
case 6:
case 5: output( "\tstp x4, x5, [SP,#-16]!\n" );
case 48: output( "\tstp x4, x5, [sp, #48]\n" );
/* fall through */
case 4:
case 3: output( "\tstp x2, x3, [SP,#-16]!\n" );
case 32: output( "\tstp x2, x3, [sp, #32]\n" );
/* fall through */
case 2:
case 1: output( "\tstp x0, x1, [SP,#-16]!\n" );
case 16: output( "\tstp x0, x1, [sp, #16]\n" );
/* fall through */
case 0: break;
default: break;
}
output( "\tmov x2, SP\n");
output( "\tstp x29, x30, [SP,#-16]!\n" );
output( "\tadd x2, sp, #16\n");
output( "\tstp x8, x9, [SP,#-16]!\n" );
output( "\tmov w1, #%u\n", odp->u.func.args_str_offset << 16 );
if (i - spec->base) output( "\tadd w1, w1, #%u\n", i - spec->base );
......@@ -358,13 +360,12 @@ static void output_relay_debug( DLLSPEC *spec )
output( "\tadd x0, x0, #%s\n", arm64_pageoff(".L__wine_spec_relay_descr") );
output( "\tldr x3, [x0, #8]\n");
output( "\tblr x3\n");
output( "\tadd SP, SP, #16\n" );
output( "\tldp x29, x30, [SP], #16\n" );
if (odp->u.func.nb_args)
output( "\tadd SP, SP, #%u\n", 8 * ((min(odp->u.func.nb_args, 8) + 1) & ~1) );
output( "\tmov sp, x29\n" );
output( "\tldp x29, x30, [sp], #%u\n", stack_size + 16 );
output( "\tret\n");
output_cfi( ".cfi_endproc" );
output_cfi( ".seh_endproc" );
break;
}
case CPU_x86_64:
output( "\t.align %d\n", get_alignment(4) );
......
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