[project @ 1999-03-11 11:21:45 by simonm]
authorsimonm <unknown>
Thu, 11 Mar 1999 11:21:47 +0000 (11:21 +0000)
committersimonm <unknown>
Thu, 11 Mar 1999 11:21:47 +0000 (11:21 +0000)
HPUX fixes.

ghc/includes/ClosureMacros.h
ghc/rts/MBlock.c
ghc/rts/StgCRun.c

index 29fcc85..f2352d9 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: ClosureMacros.h,v 1.7 1999/03/03 19:27:23 sof Exp $
+ * $Id: ClosureMacros.h,v 1.8 1999/03/11 11:21:45 simonm Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -98,8 +98,9 @@ static __inline__ StgFunPtr get_entry(const StgInfoTable *itbl) {
  * _end } end of read-write data space 
  */
 extern StgFun start;
-extern StgFun TEXT_SECTION_END_MARKER_DECL;
-extern StgFun DATA_SECTION_END_MARKER_DECL;
+
+extern StgWord TEXT_SECTION_END_MARKER_DECL[];
+extern StgWord DATA_SECTION_END_MARKER_DECL[];
 
 #define IS_CODE_PTR(p) ((P_)(p) < (P_)&TEXT_SECTION_END_MARKER)
 #define IS_DATA_PTR(p) ((P_)(p) >= (P_)&TEXT_SECTION_END_MARKER && (P_)(p) < (P_)&DATA_SECTION_END_MARKER)
index c9b4500..e8fd646 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: MBlock.c,v 1.10 1999/03/03 19:04:56 sof Exp $
+ * $Id: MBlock.c,v 1.11 1999/03/11 11:21:47 simonm Exp $
  *
  * (c) The GHC Team 1998-1999
  *
 /* guess */
 #define ASK_FOR_MEM_AT 0x50000000
 
+#elif hpux_TARGET_OS
+/* guess */
+#define ASK_FOR_MEM_AT 0x50000000
+
 #elif _WIN32
 /* doesn't matter, we use a reserve/commit algorithm */
 
@@ -91,6 +95,9 @@ getMBlocks(nat n)
                 MAP_FIXED | MAP_PRIVATE, fd, 0);
       close(fd);
   }
+#elif hpux_TARGET_OS
+ ret = mmap(next_request, size, PROT_READ | PROT_WRITE, 
+            MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
 #else
   ret = mmap(next_request, size, PROT_READ | PROT_WRITE, 
             MAP_ANON | MAP_PRIVATE, -1, 0);
index d8cc597..91e464c 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgCRun.c,v 1.4 1999/03/01 17:42:11 simonm Exp $
+ * $Id: StgCRun.c,v 1.5 1999/03/11 11:21:47 simonm Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -149,7 +149,7 @@ StgRun(StgFunPtr f)
     return (StgThreadReturnCode)R1.i;
 }
 
-#endif /* sparc_TARGET_ARCH */
+#endif /* alpha_TARGET_ARCH */
 
 /* -----------------------------------------------------------------------------
    HP-PA architecture
@@ -161,6 +161,8 @@ StgThreadReturnCode
 StgRun(StgFunPtr f) 
 {
     StgChar space[RESERVED_C_STACK_BYTES+16*sizeof(long)+10*sizeof(double)];
+    StgThredReturnCode ret;
+
     __asm__ volatile ("ldo %0(%%r30),%%r19\n"
                      "\tstw %%r3, 0(0,%%r19)\n"
                       "\tstw %%r4, 4(0,%%r19)\n"
@@ -201,7 +203,8 @@ StgRun(StgFunPtr f)
                      "\t.EXPORT " STG_RETURN ",ENTRY,PRIV_LEV=3\n"
                       STG_RETURN "\n"
                       /* "\tldo %0(%%r3),%%r19\n" */
-                      "\tldo %0(%%r30),%%r19\n"
+                      "\tldo %1(%%r30),%%r19\n"
+                      "\tcopy %%r11, %0\n"  /* save R1 */
                      "\tldw  0(0,%%r19),%%r3\n"
                       "\tldw  4(0,%%r19),%%r4\n"
                       "\tldw  8(0,%%r19),%%r5\n"
@@ -230,11 +233,13 @@ StgRun(StgFunPtr f)
                      "\tfldds   8(0,%%r19),%%fr19\n"
                      "\tldo 32(%%r19),%%r19\n"
                      "\tfldds -16(0,%%r19),%%fr20\n"
-                     "\tfldds  -8(0,%%r19),%%fr21\n" : :
-                      "n" (-(116 * sizeof(long) + 10 * sizeof(double))) : "%r19"
+                     "\tfldds  -8(0,%%r19),%%fr21\n" 
+                     : "=r" (ret) /* result */
+                      : "n" (-(116 * sizeof(long) + 10 * sizeof(double))) 
+                     : "%r19"
                      );
 
-    return (StgThreadReturnCode)R1.i;
+    return ret;
 }
 
 #endif /* hppa1_1_TARGET_ARCH */