[MLton-commit] r4567

Matthew Fluet MLton@mlton.org
Mon, 22 May 2006 20:16:10 -0700


Working on OpenBSD(3.8)
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
D   mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c
A   mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c
D   mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2006-05-23 03:16:05 UTC (rev 4567)
@@ -33,7 +33,7 @@
 else
 FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5
 endif
-ifeq ($(findstring $(GCC_VERSION), 3.4 4.0),$(GCC_VERSION))
+ifeq ($(findstring $(GCC_VERSION), 3.3 3.4 4.0),$(GCC_VERSION))
 GCOPTFLAGS += --param inline-unit-growth=125 --param max-inline-insns-single=1000
 endif
 DEBUGFLAGS += -gstabs+
@@ -63,6 +63,10 @@
 FLAGS += -I/usr/local/include
 endif
 
+ifeq ($(TARGET_OS), openbsd)
+FLAGS += -I/usr/local/include
+endif
+
 ifeq ($(TARGET_OS), solaris)
 FLAGS += -funroll-all-loops
 endif

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c	2006-05-23 03:16:05 UTC (rev 4567)
@@ -2,9 +2,9 @@
 
 #include "getText.c"
 #include "mkdir2.c"
-#include "showMem.linux.c"
+#include "displayMem.linux.c"
 #include "mmap-protect.c"
-#include "totalRam.sysctl.c"
+#include "sysctl.c"
 #include "use-mmap.c"
 
 static void catcher (__attribute__ ((unused)) int sig,

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c	2006-05-23 03:16:05 UTC (rev 4567)
@@ -2,9 +2,9 @@
 
 #include "getText.c"
 #include "mkdir2.c"
-#include "showMem.linux.c"
+#include "displayMem.linux.c"
 #include "mmap-protect.c"
-#include "totalRam.sysctl.c"
+#include "sysctl.c"
 #include "use-mmap.c"
 
 static void catcher (__attribute__ ((unused)) int sig,

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.h	2006-05-23 03:16:05 UTC (rev 4567)
@@ -24,6 +24,8 @@
 
 #define HAS_FEROUND FALSE
 #define HAS_FPCLASSIFY FALSE
+#define HAS_FPCLASSIFY32 FALSE
+#define HAS_FPCLASSIFY64 FALSE
 #define HAS_MSG_DONTWAIT TRUE
 #define HAS_REMAP FALSE
 #define HAS_SIGALTSTACK TRUE
@@ -35,3 +37,37 @@
 
 int fpclassify32 (float f);
 int fpclassify64 (double d);
+
+#ifndef PRIu8
+#define PRIu8 "hhu"
+#endif
+#ifndef PRIu16
+#define PRIu16 "hu"
+#endif
+#ifndef PRIx16
+#define PRIx16 "hx"
+#endif
+#ifndef PRId32
+#define PRId32 "d"
+#endif
+#ifndef PRIu32
+#define PRIu32 "u"
+#endif
+#ifndef PRIx32
+#define PRIx32 "x"
+#endif
+typedef long long int intmax_t;
+#ifndef INTMAX_MIN
+#define INTMAX_MIN LLONG_MIN
+#endif
+typedef unsigned long long int uintmax_t;
+#ifndef PRIuMAX
+#define PRIuMAX "llu"
+#endif
+#ifndef PRIxMAX
+#define PRIxMAX "llx"
+#endif
+
+#ifndef PRIxPTR
+#define PRIxPTR "lx"
+#endif

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/showMem.linux.c	2006-05-23 03:16:05 UTC (rev 4567)
@@ -1,6 +0,0 @@
-void showMem () {
-        static char buffer[256];
-
-        sprintf (buffer, "/bin/cat /proc/%d/maps\n", (int)(getpid ()));
-        system (buffer);
-}

Added: mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysctl.c	2006-05-23 03:16:05 UTC (rev 4567)
@@ -0,0 +1,12 @@
+size_t GC_totalRam (void) {
+  int mem;
+  size_t len;
+  int mib[2];
+        
+  mib[0] = CTL_HW;
+  mib[1] = HW_PHYSMEM;
+  len = sizeof(mem);
+  if (-1 == sysctl (mib, 2, &mem, &len, NULL, 0))
+    diee ("sysctl failed");
+  return (size_t)mem;
+}

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c	2006-05-22 22:51:00 UTC (rev 4566)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysctl.c	2006-05-23 03:16:05 UTC (rev 4567)
@@ -1,11 +0,0 @@
-W32 totalRam (GC_state s) {
-        uint mem;
-        int len, mib[2];
-        
-        mib[0] = CTL_HW;
-        mib[1] = HW_PHYSMEM;
-        len = sizeof(mem);
-        if (-1 == sysctl (mib, 2, &mem, &len, NULL, 0))
-                diee ("sysctl failed");
-        return mem;
-}