Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern regen: standalone client support f...
details: https://anonhg.NetBSD.org/src/rev/a8dd81440f0f
branches: trunk
changeset: 758435:a8dd81440f0f
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Nov 04 20:51:18 2010 +0000
description:
regen: standalone client support for rump syscalls
diffstat:
sys/rump/librump/rumpkern/rump_syscalls.c | 1069 ++++++++++++----------------
1 files changed, 476 insertions(+), 593 deletions(-)
diffs (truncated from 2885 to 300 lines):
diff -r a075fca98338 -r a8dd81440f0f sys/rump/librump/rumpkern/rump_syscalls.c
--- a/sys/rump/librump/rumpkern/rump_syscalls.c Thu Nov 04 20:50:29 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump_syscalls.c Thu Nov 04 20:51:18 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_syscalls.c,v 1.52 2010/11/01 16:22:37 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.53 2010/11/04 20:51:18 pooka Exp $ */
/*
* System call vector and marshalling for rump.
@@ -8,22 +8,49 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.52 2010/11/01 16:22:37 pooka Exp $");
-
-#include <sys/types.h>
+__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.53 2010/11/04 20:51:18 pooka Exp $");
+
#include <sys/param.h>
+#include <sys/fstypes.h>
#include <sys/proc.h>
#include <sys/syscall.h>
#include <sys/syscallargs.h>
+
+#ifdef RUMP_CLIENT
+#include <errno.h>
+#include <rump/rumpclient.h>
+
+#define rsys_syscall(num, data, dlen, retval) \
+ rumpclient_syscall(num, data, dlen, retval)
+#define rsys_seterrno(error) errno = error
+#define rsys_alias(a,b)
+#else
#include <rump/rumpuser.h>
#include "rump_private.h"
+static int
+rsys_syscall(int num, void *data, size_t dlen, register_t *retval)
+{
+ int rv;
+
+ rump_schedule();
+ rv = rump_syscall(num, data, retval);
+ rump_unschedule();
+
+ return rv;
+}
+
+#define rsys_seterrno(error) rumpuser_seterrno(error)
+#define rsys_alias(a,b) __weak_alias(a,b);
+#endif
+
#if BYTE_ORDER == BIG_ENDIAN
#define SPARG(p,k) ((p)->k.be.datum)
#else /* LITTLE_ENDIAN, I hope dearly */
#define SPARG(p,k) ((p)->k.le.datum)
#endif
+#ifndef RUMP_CLIENT
int rump_enosys(void);
int
rump_enosys()
@@ -31,6 +58,7 @@
return ENOSYS;
}
+#endif
ssize_t rump_sys_read(int, void *, size_t);
ssize_t
@@ -44,15 +72,14 @@
SPARG(&callarg, buf) = buf;
SPARG(&callarg, nbyte) = nbyte;
- error = rump_sysproxy(SYS_read, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_read, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_read,rump_enosys);
+rsys_alias(sys_read,rump_enosys)
ssize_t rump_sys_write(int, const void *, size_t);
ssize_t
@@ -66,15 +93,14 @@
SPARG(&callarg, buf) = buf;
SPARG(&callarg, nbyte) = nbyte;
- error = rump_sysproxy(SYS_write, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_write, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_write,rump_enosys);
+rsys_alias(sys_write,rump_enosys)
int rump_sys_open(const char *, int, mode_t);
int
@@ -88,15 +114,14 @@
SPARG(&callarg, flags) = flags;
SPARG(&callarg, mode) = mode;
- error = rump_sysproxy(SYS_open, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_open, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_open,rump_enosys);
+rsys_alias(sys_open,rump_enosys)
int rump_sys_close(int);
int
@@ -108,15 +133,14 @@
SPARG(&callarg, fd) = fd;
- error = rump_sysproxy(SYS_close, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_close, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_close,rump_enosys);
+rsys_alias(sys_close,rump_enosys)
int rump_sys_link(const char *, const char *);
int
@@ -129,15 +153,14 @@
SPARG(&callarg, path) = path;
SPARG(&callarg, link) = link;
- error = rump_sysproxy(SYS_link, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_link, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_link,rump_enosys);
+rsys_alias(sys_link,rump_enosys)
int rump_sys_unlink(const char *);
int
@@ -149,15 +172,14 @@
SPARG(&callarg, path) = path;
- error = rump_sysproxy(SYS_unlink, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_unlink, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_unlink,rump_enosys);
+rsys_alias(sys_unlink,rump_enosys)
int rump_sys_chdir(const char *);
int
@@ -169,15 +191,14 @@
SPARG(&callarg, path) = path;
- error = rump_sysproxy(SYS_chdir, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_chdir, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_chdir,rump_enosys);
+rsys_alias(sys_chdir,rump_enosys)
int rump_sys_fchdir(int);
int
@@ -189,15 +210,14 @@
SPARG(&callarg, fd) = fd;
- error = rump_sysproxy(SYS_fchdir, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_fchdir, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_fchdir,rump_enosys);
+rsys_alias(sys_fchdir,rump_enosys)
int rump_sys_chmod(const char *, mode_t);
int
@@ -210,15 +230,14 @@
SPARG(&callarg, path) = path;
SPARG(&callarg, mode) = mode;
- error = rump_sysproxy(SYS_chmod, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_chmod, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_chmod,rump_enosys);
+rsys_alias(sys_chmod,rump_enosys)
int rump_sys_chown(const char *, uid_t, gid_t);
int
@@ -232,15 +251,14 @@
SPARG(&callarg, uid) = uid;
SPARG(&callarg, gid) = gid;
- error = rump_sysproxy(SYS_chown, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_chown, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_chown,rump_enosys);
+rsys_alias(sys_chown,rump_enosys)
pid_t rump_sys_getpid(void);
pid_t
@@ -249,15 +267,14 @@
register_t rval[2] = {0, 0};
int error = 0;
- error = rump_sysproxy(SYS_getpid, rump_sysproxy_arg,
- (uint8_t *)NULL, 0, rval);
+ error = rsys_syscall(SYS_getpid, NULL, 0, rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_getpid_with_ppid,rump_enosys);
+rsys_alias(sys_getpid_with_ppid,rump_enosys)
int rump_sys_unmount(const char *, int);
int
@@ -270,15 +287,14 @@
SPARG(&callarg, path) = path;
SPARG(&callarg, flags) = flags;
- error = rump_sysproxy(SYS_unmount, rump_sysproxy_arg,
- (uint8_t *)&callarg, sizeof(callarg), rval);
+ error = rsys_syscall(SYS_unmount, &callarg, sizeof(callarg), rval);
if (error) {
rval[0] = -1;
- rumpuser_seterrno(error);
+ rsys_seterrno(error);
}
return rval[0];
}
-__weak_alias(sys_unmount,rump_enosys);
+rsys_alias(sys_unmount,rump_enosys)
int rump_sys_setuid(uid_t);
int
@@ -290,15 +306,14 @@
Home |
Main Index |
Thread Index |
Old Index