Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen Let event_set_handler set the void * argument t...
details: https://anonhg.NetBSD.org/src/rev/7db3159f0367
branches: trunk
changeset: 565970:7db3159f0367
user: cl <cl%NetBSD.org@localhost>
date: Sat Apr 24 19:32:37 2004 +0000
description:
Let event_set_handler set the void * argument to event handlers.
diffstat:
sys/arch/xen/include/events.h | 4 ++--
sys/arch/xen/xen/clock.c | 6 +++---
sys/arch/xen/xen/events.c | 12 ++++++------
sys/arch/xen/xen/if_xennet.c | 13 ++++---------
sys/arch/xen/xen/xbd.c | 8 ++++----
5 files changed, 19 insertions(+), 24 deletions(-)
diffs (180 lines):
diff -r affba2209a2a -r 7db3159f0367 sys/arch/xen/include/events.h
--- a/sys/arch/xen/include/events.h Sat Apr 24 19:18:01 2004 +0000
+++ b/sys/arch/xen/include/events.h Sat Apr 24 19:32:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: events.h,v 1.2 2004/04/17 12:46:42 cl Exp $ */
+/* $NetBSD: events.h,v 1.3 2004/04/24 19:32:37 cl Exp $ */
/*
*
@@ -41,6 +41,6 @@
void init_events(void);
unsigned int do_event(int, struct trapframe *);
-int event_set_handler(int, ev_handler_t, int);
+int event_set_handler(int, ev_handler_t, void *, int);
#endif /* _XEN_EVENTS_H_ */
diff -r affba2209a2a -r 7db3159f0367 sys/arch/xen/xen/clock.c
--- a/sys/arch/xen/xen/clock.c Sat Apr 24 19:18:01 2004 +0000
+++ b/sys/arch/xen/xen/clock.c Sat Apr 24 19:32:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.4 2004/04/17 21:49:55 cl Exp $ */
+/* $NetBSD: clock.c,v 1.5 2004/04/24 19:32:37 cl Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.4 2004/04/17 21:49:55 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.5 2004/04/24 19:32:37 cl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -172,7 +172,7 @@
{
event_set_handler(_EVENT_TIMER, (int (*)(void *))xen_timer_handler,
- IPL_CLOCK);
+ NULL, IPL_CLOCK);
hypervisor_enable_event(_EVENT_TIMER);
}
diff -r affba2209a2a -r 7db3159f0367 sys/arch/xen/xen/events.c
--- a/sys/arch/xen/xen/events.c Sat Apr 24 19:18:01 2004 +0000
+++ b/sys/arch/xen/xen/events.c Sat Apr 24 19:32:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: events.c,v 1.3 2004/04/17 12:46:42 cl Exp $ */
+/* $NetBSD: events.c,v 1.4 2004/04/24 19:32:37 cl Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: events.c,v 1.3 2004/04/17 12:46:42 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: events.c,v 1.4 2004/04/24 19:32:37 cl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -71,10 +71,10 @@
for (i = 0; i < MAXEVENTS; i++)
ev_vectors[i].ev_handler = NULL;
- event_set_handler(_EVENT_DIE, &xen_die_handler, IPL_DIE);
+ event_set_handler(_EVENT_DIE, &xen_die_handler, NULL, IPL_DIE);
hypervisor_enable_event(_EVENT_DIE);
- event_set_handler(_EVENT_DEBUG, &xen_debug_handler, IPL_DEBUG);
+ event_set_handler(_EVENT_DEBUG, &xen_debug_handler, NULL, IPL_DEBUG);
hypervisor_enable_event(_EVENT_DEBUG);
}
@@ -123,7 +123,7 @@
}
int
-event_set_handler(int num, ev_handler_t handler, int level)
+event_set_handler(int num, ev_handler_t handler, void *arg, int level)
{
struct intrsource *isp;
struct intrhand *ih;
@@ -151,7 +151,7 @@
isp->is_resume = xenev_stubs[num].ist_resume;
ih->ih_level = level;
ih->ih_fun = handler;
- ih->ih_arg = NULL;
+ ih->ih_arg = arg;
ih->ih_next = NULL;
isp->is_handlers = ih;
isp->is_pic = &xenev_pic;
diff -r affba2209a2a -r 7db3159f0367 sys/arch/xen/xen/if_xennet.c
--- a/sys/arch/xen/xen/if_xennet.c Sat Apr 24 19:18:01 2004 +0000
+++ b/sys/arch/xen/xen/if_xennet.c Sat Apr 24 19:32:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_xennet.c,v 1.7 2004/04/24 18:55:02 cl Exp $ */
+/* $NetBSD: if_xennet.c,v 1.8 2004/04/24 19:32:37 cl Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.7 2004/04/24 18:55:02 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.8 2004/04/24 19:32:37 cl Exp $");
#include "opt_inet.h"
@@ -184,8 +184,6 @@
return 0;
}
-static struct xennet_softc *thesc;
-
void
xennet_attach(struct device *parent, struct device *self, void *aux)
{
@@ -252,9 +250,7 @@
if_attach(ifp);
ether_ifattach(ifp, sc->sc_enaddr);
- thesc = sc;
-
- event_set_handler(_EVENT_NET, &xen_network_handler, IPL_NET);
+ event_set_handler(_EVENT_NET, &xen_network_handler, sc, IPL_NET);
hypervisor_enable_event(_EVENT_NET);
aprint_normal("%s: MAC address %s\n", sc->sc_dev.dv_xname,
@@ -288,7 +284,6 @@
DPRINTFN(XEDB_MBUF, ("xennet_rx_mbuf_free id %d, mbuf %p, buf %p, "
"size %d\n", id, m, buf, size));
- KASSERT(sc == thesc);
ringidx = sc->sc_net_idx->rx_req_prod;
@@ -320,7 +315,7 @@
static int
xen_network_handler(void *arg)
{
- struct xennet_softc *sc = thesc;
+ struct xennet_softc *sc = arg;
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
rx_resp_entry_t *rx;
paddr_t pa;
diff -r affba2209a2a -r 7db3159f0367 sys/arch/xen/xen/xbd.c
--- a/sys/arch/xen/xen/xbd.c Sat Apr 24 19:18:01 2004 +0000
+++ b/sys/arch/xen/xen/xbd.c Sat Apr 24 19:32:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xbd.c,v 1.3 2004/04/24 17:35:28 cl Exp $ */
+/* $NetBSD: xbd.c,v 1.4 2004/04/24 19:32:37 cl Exp $ */
/*
*
@@ -33,7 +33,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.3 2004/04/24 17:35:28 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.4 2004/04/24 19:32:37 cl Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -307,11 +307,11 @@
resp_cons = req_prod = 0;
event_set_handler(_EVENT_BLKDEV, &xbd_response_handler,
- IPL_BIO);
+ NULL, IPL_BIO);
hypervisor_enable_event(_EVENT_BLKDEV);
#if 0
event_set_handler(_EVENT_VBD_UPD, &xbd_update_handler,
- IPL_BIO);
+ NULL, IPL_BIO);
hypervisor_enable_event(_EVENT_VBD_UPD);
#endif
}
Home |
Main Index |
Thread Index |
Old Index