Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src rumpuser_poll() is used only by sockin, so make the hypercall
details: https://anonhg.NetBSD.org/src/rev/128596553827
branches: trunk
changeset: 786361:128596553827
user: pooka <pooka%NetBSD.org@localhost>
date: Sat Apr 27 15:01:21 2013 +0000
description:
rumpuser_poll() is used only by sockin, so make the hypercall
private to that component.
diffstat:
lib/librumpuser/rumpuser.c | 12 ++----------
sys/rump/include/rump/rumpuser.h | 6 +-----
sys/rump/net/lib/libsockin/rumpcomp_user.c | 17 ++++++++++++++++-
sys/rump/net/lib/libsockin/rumpcomp_user.h | 3 ++-
sys/rump/net/lib/libsockin/sockin.c | 6 +++---
5 files changed, 24 insertions(+), 20 deletions(-)
diffs (144 lines):
diff -r 5f692773c4ae -r 128596553827 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c Sat Apr 27 14:59:08 2013 +0000
+++ b/lib/librumpuser/rumpuser.c Sat Apr 27 15:01:21 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.c,v 1.30 2013/04/27 14:59:08 pooka Exp $ */
+/* $NetBSD: rumpuser.c,v 1.31 2013/04/27 15:01:21 pooka Exp $ */
/*
* Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
#include "rumpuser_port.h"
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.30 2013/04/27 14:59:08 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.31 2013/04/27 15:01:21 pooka Exp $");
#endif /* !lint */
#include <sys/ioctl.h>
@@ -52,7 +52,6 @@
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
-#include <poll.h>
#include <signal.h>
#include <stdarg.h>
#include <stdint.h>
@@ -591,13 +590,6 @@
}
int
-rumpuser_poll(struct pollfd *fds, int nfds, int timeout, int *error)
-{
-
- DOCALL_KLOCK(int, (poll(fds, (nfds_t)nfds, timeout)));
-}
-
-int
rumpuser_putchar(int c, int *error)
{
diff -r 5f692773c4ae -r 128596553827 sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h Sat Apr 27 14:59:08 2013 +0000
+++ b/sys/rump/include/rump/rumpuser.h Sat Apr 27 15:01:21 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.h,v 1.78 2013/04/27 14:59:09 pooka Exp $ */
+/* $NetBSD: rumpuser.h,v 1.79 2013/04/27 15:01:21 pooka Exp $ */
/*
* Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
@@ -43,8 +43,6 @@
int rumpuser_daemonize_begin(void);
int rumpuser_daemonize_done(int);
-struct pollfd;
-
typedef void (*rump_reschedulefn)(int, void *);
typedef void (*rump_unschedulefn)(int, int *, void *);
int rumpuser_init(int, rump_reschedulefn, rump_unschedulefn);
@@ -109,8 +107,6 @@
int rumpuser_gethostname(char *, size_t, int *);
-int rumpuser_poll(struct pollfd *, int, int, int *);
-
int rumpuser_putchar(int, int *);
#define RUMPUSER_PID_SELF ((int64_t)-1)
diff -r 5f692773c4ae -r 128596553827 sys/rump/net/lib/libsockin/rumpcomp_user.c
--- a/sys/rump/net/lib/libsockin/rumpcomp_user.c Sat Apr 27 14:59:08 2013 +0000
+++ b/sys/rump/net/lib/libsockin/rumpcomp_user.c Sat Apr 27 15:01:21 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpcomp_user.c,v 1.2 2013/03/19 02:07:43 christos Exp $ */
+/* $NetBSD: rumpcomp_user.c,v 1.3 2013/04/27 15:01:21 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -30,6 +30,7 @@
#include <sys/socket.h>
#include <errno.h>
+#include <poll.h>
#include <rump/rumpuser_component.h>
@@ -165,4 +166,18 @@
seterror();
return rv;
}
+
+int
+rumpcomp_sockin_poll(struct pollfd *fds, int nfds, int timeout, int *error)
+{
+ void *cookie;
+ int rv;
+
+ cookie = rumpuser_component_unschedule();
+ rv = poll(fds, (nfds_t)nfds, timeout);
+ rumpuser_component_schedule(cookie);
+
+ seterror();
+ return rv;
+}
#endif
diff -r 5f692773c4ae -r 128596553827 sys/rump/net/lib/libsockin/rumpcomp_user.h
--- a/sys/rump/net/lib/libsockin/rumpcomp_user.h Sat Apr 27 14:59:08 2013 +0000
+++ b/sys/rump/net/lib/libsockin/rumpcomp_user.h Sat Apr 27 15:01:21 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpcomp_user.h,v 1.1 2013/03/18 13:14:11 pooka Exp $ */
+/* $NetBSD: rumpcomp_user.h,v 1.2 2013/04/27 15:01:21 pooka Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -40,3 +40,4 @@
int rumpcomp_sockin_getname(int, struct sockaddr *, int *,
enum rumpcomp_sockin_getnametype, int *);
int rumpcomp_sockin_setsockopt(int, int, int, const void *, int, int *);
+int rumpcomp_sockin_poll(struct pollfd *, int, int, int *);
diff -r 5f692773c4ae -r 128596553827 sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c Sat Apr 27 14:59:08 2013 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c Sat Apr 27 15:01:21 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sockin.c,v 1.27 2013/03/18 13:14:11 pooka Exp $ */
+/* $NetBSD: sockin.c,v 1.28 2013/04/27 15:01:21 pooka Exp $ */
/*
* Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.27 2013/03/18 13:14:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.28 2013/04/27 15:01:21 pooka Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -300,7 +300,7 @@
}
/* find affected sockets & process */
- rv = rumpuser_poll(pfds, cursock, POLLTIMEOUT, &error);
+ rv = rumpcomp_sockin_poll(pfds, cursock, POLLTIMEOUT, &error);
for (i = 0; i < cursock && rv > 0; i++) {
if (pfds[i].revents & POLLIN) {
mutex_enter(&su_mtx);
Home |
Main Index |
Thread Index |
Old Index