X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FAdjustorAsm.S;h=cfdef68349717788f4d48f89778ca13992e86b61;hb=28a464a75e14cece5db40f2765a29348273ff2d2;hp=3927843830b52911a02bd270bebbc9d3668ef167;hpb=153b9cb9b11e05c4edb1b6bc0a7b972660e41f70;p=ghc-hetmet.git diff --git a/ghc/rts/AdjustorAsm.S b/ghc/rts/AdjustorAsm.S index 3927843..cfdef68 100644 --- a/ghc/rts/AdjustorAsm.S +++ b/ghc/rts/AdjustorAsm.S @@ -1,5 +1,7 @@ #include "../includes/ghcconfig.h" +/* ******************************** PowerPC ******************************** */ + #if defined(powerpc_HOST_ARCH) || defined(powerpc64_HOST_ARCH) #if !(defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS)) /* The following code applies, with some differences, @@ -142,5 +144,46 @@ adjustorCode: mtlr r0 blr #endif + +/* ********************************* i386 ********************************** */ + +#elif defined(i386_HOST_ARCH) && defined(darwin_HOST_OS) + +#define WS 4 +#define RETVAL_OFF 5 +#define HEADER_BYTES 8 + +#define HPTR_OFF HEADER_BYTES +#define WPTR_OFF (HEADER_BYTES + 1*WS) +#define FRAMESIZE_OFF (HEADER_BYTES + 2*WS) +#define ARGWORDS_OFF (HEADER_BYTES + 3*WS) + + .globl _adjustorCode +_adjustorCode: + popl %eax + subl $RETVAL_OFF, %eax + + pushl %ebp + movl %esp, %ebp + + subl FRAMESIZE_OFF(%eax), %esp + + pushl %esi + pushl %edi + + leal 8(%ebp), %esi + leal 12(%esp), %edi + movl ARGWORDS_OFF(%eax), %ecx + rep + movsl + + popl %edi + popl %esi + + pushl HPTR_OFF(%eax) + call *WPTR_OFF(%eax) + + leave + ret #endif