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 Use std. uiomove() & friends.
details: https://anonhg.NetBSD.org/src/rev/1c3f6c114b7d
branches: trunk
changeset: 748749:1c3f6c114b7d
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Nov 04 16:55:20 2009 +0000
description:
Use std. uiomove() & friends.
diffstat:
sys/rump/librump/rumpkern/Makefile.rumpkern | 10 +-
sys/rump/librump/rumpkern/emul.c | 82 +++++++---------------------
sys/rump/librump/rumpkern/vm.c | 22 +++++++-
3 files changed, 47 insertions(+), 67 deletions(-)
diffs (191 lines):
diff -r 6a5ddd0a59be -r 1c3f6c114b7d sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Nov 04 16:54:00 2009 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Nov 04 16:55:20 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rumpkern,v 1.57 2009/11/04 13:32:39 pooka Exp $
+# $NetBSD: Makefile.rumpkern,v 1.58 2009/11/04 16:55:20 pooka Exp $
#
.include "${RUMPTOP}/Makefile.rump"
@@ -37,10 +37,10 @@
sys_descrip.c sys_generic.c sys_select.c syscalls.c
# sys/kern subr (misc)
-SRCS+= subr_devsw.c subr_callback.c subr_evcnt.c subr_extent.c \
- subr_hash.c subr_humanize.c subr_iostat.c subr_kobj.c \
- subr_log.c subr_once.c subr_prf.c subr_specificdata.c \
- subr_time.c subr_workqueue.c
+SRCS+= subr_devsw.c subr_callback.c subr_copy.c subr_evcnt.c \
+ subr_extent.c subr_hash.c subr_humanize.c subr_iostat.c \
+ subr_kobj.c subr_log.c subr_once.c subr_prf.c \
+ subr_specificdata.c subr_time.c subr_workqueue.c
# sys/uvm
SRCS+= uvm_readahead.c
diff -r 6a5ddd0a59be -r 1c3f6c114b7d sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c Wed Nov 04 16:54:00 2009 +0000
+++ b/sys/rump/librump/rumpkern/emul.c Wed Nov 04 16:55:20 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emul.c,v 1.104 2009/10/21 23:13:53 rmind Exp $ */
+/* $NetBSD: emul.c,v 1.105 2009/11/04 16:55:20 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.104 2009/10/21 23:13:53 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.105 2009/11/04 16:55:20 pooka Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@@ -140,6 +140,17 @@
}
int
+subyte(void *uaddr, int byte)
+{
+
+ if (curproc->p_vmspace == &rump_vmspace)
+ *(char *)uaddr = byte;
+ else
+ rump_sysproxy_copyout(&byte, uaddr, 1);
+ return 0;
+}
+
+int
copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done)
{
@@ -173,20 +184,6 @@
}
int
-copyin_vmspace(struct vmspace *vm, const void *uaddr, void *kaddr, size_t len)
-{
-
- return copyin(uaddr, kaddr, len);
-}
-
-int
-copyout_vmspace(struct vmspace *vm, const void *kaddr, void *uaddr, size_t len)
-{
-
- return copyout(kaddr, uaddr, len);
-}
-
-int
kcopy(const void *src, void *dst, size_t len)
{
@@ -194,50 +191,6 @@
return 0;
}
-int
-uiomove(void *buf, size_t n, struct uio *uio)
-{
- struct iovec *iov;
- uint8_t *b = buf;
- size_t cnt;
-
- if (uio->uio_vmspace != UIO_VMSPACE_SYS)
- panic("%s: vmspace != UIO_VMSPACE_SYS", __func__);
-
- while (n && uio->uio_resid) {
- iov = uio->uio_iov;
- cnt = iov->iov_len;
- if (cnt == 0) {
- uio->uio_iov++;
- uio->uio_iovcnt--;
- continue;
- }
- if (cnt > n)
- cnt = n;
-
- if (uio->uio_rw == UIO_READ)
- memcpy(iov->iov_base, b, cnt);
- else
- memcpy(b, iov->iov_base, cnt);
-
- iov->iov_base = (uint8_t *)iov->iov_base + cnt;
- iov->iov_len -= cnt;
- b += cnt;
- uio->uio_resid -= cnt;
- uio->uio_offset += cnt;
- n -= cnt;
- }
-
- return 0;
-}
-
-void
-uio_setup_sysspace(struct uio *uio)
-{
-
- uio->uio_vmspace = UIO_VMSPACE_SYS;
-}
-
devclass_t
device_class(device_t dev)
{
@@ -675,6 +628,15 @@
}
int
+proc_vmspace_getref(struct proc *p, struct vmspace **vm)
+{
+
+ /* XXX */
+ *vm = p->p_vmspace;
+ return 0;
+}
+
+int
ttycheckoutq(struct tty *tp, int wait)
{
diff -r 6a5ddd0a59be -r 1c3f6c114b7d sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c Wed Nov 04 16:54:00 2009 +0000
+++ b/sys/rump/librump/rumpkern/vm.c Wed Nov 04 16:55:20 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm.c,v 1.65 2009/10/21 23:13:53 rmind Exp $ */
+/* $NetBSD: vm.c,v 1.66 2009/11/04 16:55:20 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.65 2009/10/21 23:13:53 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.66 2009/11/04 16:55:20 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -661,6 +661,24 @@
/* nothing to wait for */
}
+void
+uvmspace_free(struct vmspace *vm)
+{
+
+ /* nothing for now */
+}
+
+int
+uvm_io(struct vm_map *map, struct uio *uio)
+{
+
+ /*
+ * just do direct uio for now. but this needs some vmspace
+ * olympics for rump_sysproxy.
+ */
+ return uiomove((void *)(vaddr_t)uio->uio_offset, uio->uio_resid, uio);
+}
+
/*
* page life cycle stuff. it really doesn't exist, so just stubs.
*/
Home |
Main Index |
Thread Index |
Old Index