[MLton-commit] r4499
Stephen Weeks
MLton@mlton.org
Mon, 8 May 2006 19:43:14 -0700
Finished first round of Solaris port. The runtime now compiles.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c 2006-05-09 02:41:50 UTC (rev 4498)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/solaris.c 2006-05-09 02:43:13 UTC (rev 4499)
@@ -9,19 +9,6 @@
#include "sysconf.c"
#include "setenv.putenv.c"
-static void catcher (int sig, siginfo_t *sip, ucontext_t *ucp) {
- GC_handleSigProf ((pointer) ucp->uc_mcontext.gregs[REG_PC]);
-}
-
-void setSigProfHandler (struct sigaction *sa) {
- sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
- sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
-}
-
-void decommit (void *base, size_t length) {
- smunmap (base, length);
-}
-
int fegetround () {
int mode;
@@ -69,10 +56,35 @@
die ("Real_class error: invalid class %d\n", c);
}
}
-
+
+/* ------------------------------------------------- */
+/* GC */
+/* ------------------------------------------------- */
+
+void GC_displayMem () {
+ static char buffer[256];
+ sprintf (buffer, "pmap %d\n", (int)(getpid ()));
+ system (buffer);
+}
+
+static void catcher (__attribute__ ((unused)) int sig,
+ __attribute__ ((unused)) siginfo_t *sip,
+ ucontext_t *ucp) {
+ GC_handleSigProf ((pointer) ucp->uc_mcontext.gregs[REG_PC]);
+}
+
+void GC_setSigProfHandler (struct sigaction *sa) {
+ sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
+ sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
+}
+
+void GC_decommit (void *base, size_t length) {
+ munmap_safe (base, length);
+}
+
/* On Solaris 5.7, MAP_ANON causes EINVAL and mmap requires a file descriptor.
*/
-void *mmapAnon (void *start, size_t length) {
+void *GC_mmapAnon (void *start, size_t length) {
static int fd = -1;
if (-1 == fd)
@@ -80,12 +92,6 @@
return mmap (start, length, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
}
-void release (void *base, size_t length) {
- smunmap (base, length);
+void GC_release (void *base, size_t length) {
+ munmap_safe (base, length);
}
-
-void showMem () {
- static char buffer[256];
- sprintf (buffer, "pmap %d\n", (int)(getpid ()));
- system (buffer);
-}