[kaffe] CVS kaffe (robilad): Removed currently unused mmap and msync native wrappers

Kaffe CVS cvs-commits at kaffe.org
Tue Sep 12 15:37:18 PDT 2006


PatchSet 7414 
Date: 2006/09/12 22:26:53
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Removed currently unused mmap and msync native wrappers

2006-09-13  Dalibor Topic  <robilad at kaffe.org>

        * include/jsyscall.h (SystemCallInterface):
        Removed _mmap and _msync. (KMMAP, KMSYNC,
        KAFFE_MMAP_READ, KAFFE_MMAP_WRITE,
        KAFFE_MMAP_PRIVATE) Removed, since they are
        currently unused.

        * kaffe/kaffeh/support.c (Kaffe_SystemCallInterface):
        Removed mmap and msync entries.

        * kaffe/kaffevm/systems/beos-native/syscalls.c
        (beos_native_mmap): Removed.
        (Kaffe_SystemCallInterface): Removed mmap entry.

        * kaffe/kaffevm/systems/drops-l4threads/syscalls.c
        (drops_mmap, drops_msync): Removed.
        (Kaffe_SystemCallInterface): Removed drops_mmap
        and drops_msync entry.

        * kaffe/kaffevm/systems/oskit-pthreads/syscalls.c
        (oskit_pthread_mmap) Removed.
        (Kaffe_SystemCallInterface): Removed
        oskit_pthread_mmap entry.

        * kaffe/kaffevm/systems/unix-jthreads/syscalls.c
        (jthreadedMmap, jthreadedMsync) Removed.
        (Kaffe_SystemCallInterface): Removed jthreadedMmap
        and jthreadedMsync entries.

        * kaffe/kaffevm/systems/unix-pthreads/syscalls.c
        (jthreadedMmap, jthreadedMsync) Removed.
        (Kaffe_SystemCallInterface): Removed jthreadedMmap
        and jthreadedMsync entries.

Members: 
	ChangeLog:1.4916->1.4917 
	include/jsyscall.h:1.27->1.28 
	kaffe/kaffeh/support.c:1.52->1.53 
	kaffe/kaffevm/systems/beos-native/syscalls.c:1.11->1.12 
	kaffe/kaffevm/systems/drops-l4threads/syscalls.c:1.2->1.3 
	kaffe/kaffevm/systems/oskit-pthreads/syscalls.c:1.11->1.12 
	kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.20->1.21 
	kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.38->1.39 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4916 kaffe/ChangeLog:1.4917
--- kaffe/ChangeLog:1.4916	Sun Sep 10 11:33:41 2006
+++ kaffe/ChangeLog	Tue Sep 12 22:26:53 2006
@@ -1,3 +1,38 @@
+2006-09-13  Dalibor Topic  <robilad at kaffe.org>
+
+	* include/jsyscall.h (SystemCallInterface):
+	Removed _mmap and _msync. (KMMAP, KMSYNC, 
+	KAFFE_MMAP_READ, KAFFE_MMAP_WRITE, 
+	KAFFE_MMAP_PRIVATE) Removed, since they are
+	currently unused.
+
+	* kaffe/kaffeh/support.c (Kaffe_SystemCallInterface):
+	Removed mmap and msync entries.
+
+	* kaffe/kaffevm/systems/beos-native/syscalls.c
+	(beos_native_mmap): Removed.
+	(Kaffe_SystemCallInterface): Removed mmap entry.
+
+	* kaffe/kaffevm/systems/drops-l4threads/syscalls.c
+	(drops_mmap, drops_msync): Removed.
+	(Kaffe_SystemCallInterface): Removed drops_mmap 
+	and drops_msync entry.
+
+	* kaffe/kaffevm/systems/oskit-pthreads/syscalls.c
+	(oskit_pthread_mmap) Removed.
+	(Kaffe_SystemCallInterface): Removed 
+	oskit_pthread_mmap entry.
+
+	* kaffe/kaffevm/systems/unix-jthreads/syscalls.c
+	(jthreadedMmap, jthreadedMsync) Removed.
+	(Kaffe_SystemCallInterface): Removed jthreadedMmap
+	and jthreadedMsync entries.
+
+	* kaffe/kaffevm/systems/unix-pthreads/syscalls.c
+        (jthreadedMmap, jthreadedMsync) Removed.
+        (Kaffe_SystemCallInterface): Removed jthreadedMmap 
+        and jthreadedMsync entries.
+
 2006-09-10  Jim Huang  <jserv at kaffe.org>
 
 	* po/zh_TW.po,
Index: kaffe/include/jsyscall.h
diff -u kaffe/include/jsyscall.h:1.27 kaffe/include/jsyscall.h:1.28
--- kaffe/include/jsyscall.h:1.27	Wed May 24 11:43:12 2006
+++ kaffe/include/jsyscall.h	Tue Sep 12 22:26:58 2006
@@ -95,9 +95,7 @@
 	int	(*_waitpid)(int, int *, int, int *);
 	int	(*_kill)(int, int);
 
-	int	(*_mmap)(void **, size_t *, int, int fd, off_t *);
 	int	(*_munmap)(void *, size_t);
-	int	(*_msync)(void *, size_t);
 
 	int	(*_pipecreate)(int *, int *);
 	int	(*_piperead)(int, void *, size_t, int, ssize_t *);
@@ -252,19 +250,13 @@
 #define	KFORKEXEC(A,B,C,D,E) \
 			(*Kaffe_SystemCallInterface._forkexec)(A,B,C,D,E)
 #define	KKILL(A,B)	(*Kaffe_SystemCallInterface._kill)(A,B)
-#define KMMAP(A,B,C,D,E) (*Kaffe_SystemCallInterface._mmap)(A,B,C,D,E)
 #define KMUNMAP(A,B)  (*Kaffe_SystemCallInterface._munmap)(A,B)
-#define KMSYNC(A,B)  (*Kaffe_SystemCallInterface._msync)(A,B)
 
 #define KPIPECREATE(A,B)   (*Kaffe_SystemCallInterface._pipecreate)(A,B)
 #define KPIPEREAD(A,B,C,D,E) (*Kaffe_SystemCallInterface._piperead)(A,B,C,D,E)
 #define KPIPEWRITE(A,B,C,D,E) (*Kaffe_SystemCallInterface._pipewrite)(A,B,C,D,E)
 
 #define KSOCKSHUTDOWN(A) (*Kaffe_SystemCallInterface._sockShutdown)(A)
-
-#define KAFFE_MMAP_READ 0
-#define KAFFE_MMAP_WRITE 1
-#define KAFFE_MMAP_PRIVATE 2
 
 #define NOTIMEOUT (-1)
 
Index: kaffe/kaffe/kaffeh/support.c
diff -u kaffe/kaffe/kaffeh/support.c:1.52 kaffe/kaffe/kaffeh/support.c:1.53
--- kaffe/kaffe/kaffeh/support.c:1.52	Mon Dec 19 23:14:18 2005
+++ kaffe/kaffe/kaffeh/support.c	Tue Sep 12 22:26:58 2006
@@ -144,9 +144,7 @@
         NULL,		/* forkexec */
         NULL,		/* waitpid */
         NULL,		/* kill */
-	NULL,           /* mmap */
         NULL,           /* munmap */
-        NULL,           /* msync */
         NULL,           /* pipecreate */
         NULL,           /* piperead */
         NULL            /* pipewrite */
Index: kaffe/kaffe/kaffevm/systems/beos-native/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/beos-native/syscalls.c:1.11 kaffe/kaffe/kaffevm/systems/beos-native/syscalls.c:1.12
--- kaffe/kaffe/kaffevm/systems/beos-native/syscalls.c:1.11	Sat Jul 26 17:28:34 2003
+++ kaffe/kaffe/kaffevm/systems/beos-native/syscalls.c	Tue Sep 12 22:26:59 2006
@@ -500,12 +500,6 @@
 }
 
 static int
-beos_native_mmap(void **memory, size_t *size, int mode, int fd, off_t *offset)
-{
-	return B_UNSUPPORTED;
-}
-
-static int
 beos_native_munmap(void *memory, size_t size)
 {
 	return B_UNSUPPORTED;
@@ -544,6 +538,5 @@
 	beos_native_forkexec,
 	beos_native_waitpid,
 	beos_native_kill,
-	beos_native_mmap,
 	beos_native_munmap
 };
Index: kaffe/kaffe/kaffevm/systems/drops-l4threads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/drops-l4threads/syscalls.c:1.2 kaffe/kaffe/kaffevm/systems/drops-l4threads/syscalls.c:1.3
--- kaffe/kaffe/kaffevm/systems/drops-l4threads/syscalls.c:1.2	Fri Nov 25 21:05:55 2005
+++ kaffe/kaffe/kaffevm/systems/drops-l4threads/syscalls.c	Tue Sep 12 22:26:59 2006
@@ -341,25 +341,12 @@
   return -1;
 }
 
-static int drops_mmap(void **memory UNUSED, size_t *size UNUSED,
-                      int mode UNUSED, int fd UNUSED,
-                      off_t *offset UNUSED) {
-  unimp("mmap() not implemented");
-  return -1;
-}
-
 static int drops_munmap(void *memory UNUSED,
                         size_t size UNUSED) {
   unimp("munmap() not implemented");
   return -1;
 }
 
-static int drops_msync(void *memory UNUSED,
-                       size_t length UNUSED) {
-  unimp("msync() not implemented");
-  return -1;
-}
-
 static int drops_pipecreate(int * a UNUSED, int *b UNUSED) {
   unimp("pipecreate() not implemented");
   return -1;
@@ -414,9 +401,7 @@
 	drops_forkexec,
 	drops_waitpid,
 	drops_kill,
-	drops_mmap,
         drops_munmap,
-        drops_msync,
         drops_pipecreate,
         drops_piperead,
         drops_pipewrite
Index: kaffe/kaffe/kaffevm/systems/oskit-pthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/oskit-pthreads/syscalls.c:1.11 kaffe/kaffe/kaffevm/systems/oskit-pthreads/syscalls.c:1.12
--- kaffe/kaffe/kaffevm/systems/oskit-pthreads/syscalls.c:1.11	Tue May  3 20:43:03 2005
+++ kaffe/kaffe/kaffevm/systems/oskit-pthreads/syscalls.c	Tue Sep 12 22:26:59 2006
@@ -318,12 +318,6 @@
 }
 
 static int
-oskit_pthread_mmap(void **memory, size_t *size, )
-{
-	return (EOPNOTSUPP);
-}
-
-static int
 oskit_pthread_munmap(void *memory, size_t size)
 {
 	return (EOPNOTSUPP);
@@ -362,6 +356,5 @@
 	oskit_pthread_forkexec,
 	oskit_pthread_waitpid,
 	oskit_pthread_kill,
-	oskit_pthread_mmap,
 	oskit_pthread_munmap
 };
Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.20 kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.21
--- kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.20	Wed May 24 11:43:13 2006
+++ kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c	Tue Sep 12 22:27:00 2006
@@ -325,50 +325,6 @@
 }
 
 static int
-jthreadedMmap(void **memory, size_t *size, int mode, int fd, off_t *offset)
-{
-#if defined(HAVE_MMAP)
-	size_t pages_sz;
-	off_t pages_offset;
-	int sysmode, sysflags;
-	int rc = 0;
-
-	pages_sz = (*size)/getpagesize();
-	*size = (pages_sz+1)*getpagesize();
-  
-	pages_offset = (*offset)/getpagesize();
-	*offset = pages_offset*getpagesize();
-
-	switch (mode) {
-		case KAFFE_MMAP_READ:
-			sysflags = MAP_PRIVATE;
-			sysmode = PROT_READ;
-			break;
-		case KAFFE_MMAP_WRITE:
-			sysflags = MAP_SHARED;
-			sysmode = PROT_READ | PROT_WRITE;
-			break;
-		case KAFFE_MMAP_PRIVATE:
-			sysflags = MAP_PRIVATE;
-			sysmode = PROT_WRITE | PROT_READ;
-			break;
-		default:
-			return EINVAL;
-	}
-
-	jthread_spinon(0);
-	*memory = mmap(*memory, *size, sysmode, sysflags, fd, *offset);
-	if (*memory == NULL)
-		rc = errno;
-
-	jthread_spinoff(0);
-	return (rc);
-#else
-	return (ENOTSUP);
-#endif
-}
-
-static int
 jthreadedMunmap(void *memory, size_t size)
 {
 #if defined(HAVE_MMAP)
@@ -385,27 +341,6 @@
 #endif
 }
 
-static int
-jthreadedMsync(void *memory, size_t size)
-{
-#if defined(HAVE_MMAP)
-	int rc = 0;
-
-	jthread_spinon(0);
-	memory = (void *)(((size_t)memory/getpagesize()) * getpagesize());
-	size += getpagesize();
-	/* TODO: Try not to freeze the entire VM. */
-	if (msync(memory, size, MS_SYNC | MS_INVALIDATE) < 0) {
-		rc = errno;
-	}
-	jthread_spinoff(0);
-
-	return rc;
-#else
-	return (ENOTSUP);
-#endif
-}
-
 /*
  * The syscall interface as provided by the internal jthread system.
  */
@@ -444,9 +379,7 @@
         jthreadedForkExec,
         jthreadedWaitpid,
         jthreadedKill,
-        jthreadedMmap,
         jthreadedMunmap,
-        jthreadedMsync,
 	jthreadedPipeCreate,
         jthreadedTimedRead,
 	jthreadedTimedWrite
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.38 kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.39
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.38	Wed May 24 11:43:13 2006
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c	Tue Sep 12 22:27:00 2006
@@ -790,47 +790,6 @@
 }
 
 static int
-jthreadedMmap(void **memory, size_t *size, int mode, int fd, off_t *offset)
-{
-#if defined(HAVE_MMAP)
-	size_t pages_sz;
-	off_t pages_offset;
-	int sysmode, sysflags;
-	int rc = 0;
-
-	pages_sz = (*size)/getpagesize();
-	*size = (pages_sz+1)*getpagesize();
-  
-	pages_offset = (*offset)/getpagesize();
-	*offset = pages_offset*getpagesize();
-
-	switch (mode) {
-		case KAFFE_MMAP_READ:
-			sysflags = MAP_SHARED;
-			sysmode = PROT_READ;
-			break;
-		case KAFFE_MMAP_WRITE:
-			sysflags = MAP_SHARED;
-			sysmode = PROT_WRITE | PROT_READ;
-			break;
-		case KAFFE_MMAP_PRIVATE:
-			sysflags = MAP_PRIVATE;
-			sysmode = PROT_WRITE | PROT_READ;
-			break;
-		default:
-			return -EINVAL;
-	}
-
-	*memory = mmap(*memory, *size, sysmode, sysflags, fd, *offset);
-
-	return (rc);
-#else
-	return (ENOTSUP);
-#endif
-}
-
-
-static int
 jthreadedMunmap(void *memory, size_t size)
 {
 #if defined(HAVE_MMAP)
@@ -846,25 +805,6 @@
 }
 
 static int
-jthreadedMsync(void *memory, size_t size)
-{
-#if defined(HAVE_MMAP)
-        int rc = 0;
-
-        memory = (void *)(((size_t)memory/getpagesize()) * getpagesize());
-        size += getpagesize();
-        /* TODO: Try not to freeze the entire VM. */
-        if (msync(memory, size, MS_SYNC | MS_INVALIDATE) < 0) {
-            rc = errno;
-        }
-
-        return rc;
-#else
-        return (ENOTSUP);
-#endif
-}
-
-static int
 jthreadedPipeCreate(int *read_fd, int *write_fd)
 {
 	int pairs[2];
@@ -919,9 +859,7 @@
         jthreadedForkExec,
         jthreadedWaitpid,
         jthreadedKill,
-        jthreadedMmap,
         jthreadedMunmap,
-	jthreadedMsync,
 	jthreadedPipeCreate,
 	jthreadedTimedRead,
 	jthreadedTimedWrite




More information about the kaffe mailing list