=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: winebuild: Generate relay debugging thunks for ARM.

Alexandre Julliard julliard at winehq.org
Mon Jul 16 14:14:28 CDT 2012


Module: wine
Branch: master
Commit: 83b60a7b0d592850c4d6b5cf3a43e71dd5cbdba2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=83b60a7b0d592850c4d6b5cf3a43e71dd5cbdba2

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sun Jul 15 16:41:56 2012 +0200

winebuild: Generate relay debugging thunks for ARM.

---

 tools/winebuild/spec32.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 3dff304..7892f22 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -83,7 +83,7 @@ int has_relays( DLLSPEC *spec )
 {
     int i;
 
-    if (target_cpu != CPU_x86 && target_cpu != CPU_x86_64) return 0;
+    if (target_cpu != CPU_x86 && target_cpu != CPU_x86_64 && target_cpu != CPU_ARM) return 0;
 
     for (i = spec->base; i <= spec->limit; i++)
     {
@@ -210,6 +210,34 @@ static void output_relay_debug( DLLSPEC *spec )
             }
             break;
 
+        case CPU_ARM:
+            switch (args)
+            {
+            default: output( "\tpush {r0-r3}\n" ); break;
+            case 3:  output( "\tpush {r0-r2}\n" ); break;
+            case 2:  output( "\tpush {r0-r1}\n" ); break;
+            case 1:  output( "\tpush {r0}\n" ); break;
+            case 0:  break;
+            }
+            output( "\tpush {LR}\n" );
+            output( "\tmov r2, SP\n");
+            if (odp->flags & FLAG_RET64) flags |= 1;
+            output( "\tmov r1, #%u\n", (flags << 24) );
+            if (args) output( "\tadd r1, #%u\n", (args << 16) );
+            if ((i - spec->base) & 0xf000) output( "\tadd r1, #%u\n", (i - spec->base) & 0xf000 );
+            if ((i - spec->base) & 0x0f00) output( "\tadd r1, #%u\n", (i - spec->base) & 0x0f00 );
+            if ((i - spec->base) & 0x00f0) output( "\tadd r1, #%u\n", (i - spec->base) & 0x00f0 );
+            if ((i - spec->base) & 0x000f) output( "\tadd r1, #%u\n", (i - spec->base) & 0x000f );
+            output( "\tldr r0, [PC, #0]\n");
+            output( "\tmov PC, PC\n");
+            output( "\t.long .L__wine_spec_relay_descr\n" );
+            output( "\tldr r3, [r0, #4]\n");
+            output( "\tblx r3\n");
+            output( "\tpop {r3}\n" );
+            if (args) output( "\tadd SP, SP, #%u\n", min(args*4, 16) );
+            output( "\tbx r3\n");
+            break;
+
         case CPU_x86_64:
             output( "\tsubq $40,%%rsp\n" );
             output_cfi( ".cfi_adjust_cfa_offset 40" );




More information about the wine-cvs mailing list