* darwin_stop_world.c: Update for -m64 multilib.
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Mar 2005 00:48:39 +0000 (00:48 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Mar 2005 00:48:39 +0000 (00:48 +0000)
        * include/private/gcconfig.h: Likewise.
        * powerpc_darwin_mach_dep.s: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96968 138bc75d-0d04-0410-961f-82ee72b054a4

boehm-gc/ChangeLog
boehm-gc/darwin_stop_world.c
boehm-gc/include/private/gcconfig.h
boehm-gc/powerpc_darwin_mach_dep.s

index 9b5852d..413c261 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-23  Mike Stump  <mrs@apple.com>
+
+       * darwin_stop_world.c: Update for -m64 multilib.
+       * include/private/gcconfig.h: Likewise.
+       * powerpc_darwin_mach_dep.s: Likewise.
+
 2005-03-01  Kelley Cook  <kcook@gcc.gnu.org>
 
        * Makefile.in, include/Makefile.in: Regenerate.
index 36378cb..2fad947 100644 (file)
@@ -1,5 +1,7 @@
 #include "private/pthread_support.h"
 
+/* This probably needs more porting work to ppc64. */
+
 # if defined(GC_DARWIN_THREADS)
 
 /* From "Inside Mac OS X - Mach-O Runtime Architecture" published by Apple
 */
 #define PPC_RED_ZONE_SIZE 224
 
-/* Not 64-bit clean. Wait until Apple defines their 64-bit ABI */
 typedef struct StackFrame {
-  unsigned int savedSP;
-  unsigned int savedCR;
-  unsigned int savedLR;
-  unsigned int reserved[2];
-  unsigned int savedRTOC;
+  unsigned long        savedSP;
+  unsigned long        savedCR;
+  unsigned long        savedLR;
+  unsigned long        reserved[2];
+  unsigned long        savedRTOC;
 } StackFrame;
 
 
index 64cbde2..fbabded 100644 (file)
 #   define MACOS
 #   define mach_type_known
 # endif
-# if defined(macosx) || \
-     defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
+# if defined(macosx) \
+     || defined(__APPLE__) && defined(__MACH__) && defined(__ppc__) \
+     || defined(__APPLE__) && defined(__MACH__) && defined(__ppc64__)
 #    define DARWIN
 #    define POWERPC
 #    define mach_type_known
 #     define DATAEND (_end)
 #   endif
 #   ifdef DARWIN
-#     define ALIGNMENT 4
+#     if (defined (__ppc64__))
+#       define ALIGNMENT 8
+#       define CPP_WORDSZ 64
+#     else
+#       define ALIGNMENT 4
+#     endif
 #     define OS_TYPE "DARWIN"
 #     define DYNAMIC_LOADING
       /* XXX: see get_end(3), get_etext() and get_end() should not be used.
index 83f06cf..694005f 100644 (file)
@@ -1,10 +1,21 @@
+#if defined(__ppc64__)
+#define MODE_CHOICE(x, y) y
+#else
+#define MODE_CHOICE(x, y) x
+#endif
+
+#define lgu     MODE_CHOICE(lwzu, ldu)
+
+#define g_long  MODE_CHOICE(long, quad)         /* usage is ".g_long" */
+
+#define LOG2_GPR_BYTES  MODE_CHOICE(2,3)        /* log2(GPR_BYTES) */
 
 ; GC_push_regs function. Under some optimization levels GCC will clobber
 ; some of the non-volatile registers before we get a chance to save them
 ; therefore, this can't be inline asm.
 
 .text
-       .align 2
+       .align LOG2_GPR_BYTES
        .globl _GC_push_regs
 _GC_push_regs:
     
@@ -65,7 +76,7 @@ _GC_push_regs:
 
 .data
 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
+       .align LOG2_GPR_BYTES
 L_GC_push_one$stub:
        .indirect_symbol _GC_push_one
        mflr r0
@@ -74,11 +85,11 @@ L0$_GC_push_one:
        mflr r11
        addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
        mtlr r0
-       lwzu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
+       lgu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
        mtctr r12
        bctr
 .data
 .lazy_symbol_pointer
 L_GC_push_one$lazy_ptr:
        .indirect_symbol _GC_push_one
-       .long dyld_stub_binding_helper
+       .g_long dyld_stub_binding_helper