aboutsummaryrefslogtreecommitdiffstats
path: root/netbsd-2.0-xen-sparse
diff options
context:
space:
mode:
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>2004-10-04 13:23:57 +0000
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>2004-10-04 13:23:57 +0000
commit2c70324cb10dd5d342df7f8b9e34685ae3ec337d (patch)
treee715a5cf4f7036d0d62b2a350970e26dc6e8f85a /netbsd-2.0-xen-sparse
parente6521d710d81d983ed87a1f27be7f33a0ed8576d (diff)
downloadxen-2c70324cb10dd5d342df7f8b9e34685ae3ec337d.tar.gz
xen-2c70324cb10dd5d342df7f8b9e34685ae3ec337d.tar.bz2
xen-2c70324cb10dd5d342df7f8b9e34685ae3ec337d.zip
bitkeeper revision 1.1159.99.2 (41614eedRuLOjlI5-39Ib0z3OZYFgA)
g/c kthread code.
Diffstat (limited to 'netbsd-2.0-xen-sparse')
-rw-r--r--netbsd-2.0-xen-sparse/sys/arch/xen/include/ctrl_if.h1
-rw-r--r--netbsd-2.0-xen-sparse/sys/arch/xen/xen/ctrl_if.c65
-rw-r--r--netbsd-2.0-xen-sparse/sys/arch/xen/xen/xencons.c1
3 files changed, 9 insertions, 58 deletions
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/include/ctrl_if.h b/netbsd-2.0-xen-sparse/sys/arch/xen/include/ctrl_if.h
index 6d6bfe172f..79f4859e80 100644
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/ctrl_if.h
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/ctrl_if.h
@@ -117,6 +117,7 @@ void ctrl_if_suspend(void);
void ctrl_if_resume(void);
/* Start-of-day setup. */
+void ctrl_if_early_init(void);
void ctrl_if_init(void);
/*
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/ctrl_if.c b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/ctrl_if.c
index d81068b0a1..edeb2bed8c 100644
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/ctrl_if.c
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/ctrl_if.c
@@ -13,7 +13,6 @@ __KERNEL_RCSID(0, "$NetBSD$");
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
-#include <sys/kthread.h>
#include <machine/xen.h>
#include <machine/hypervisor.h>
@@ -77,8 +76,6 @@ static void __ctrl_if_tx_tasklet(unsigned long data);
static void __ctrl_if_rx_tasklet(unsigned long data);
-static void ctrl_if_kthread(void *);
-
#define get_ctrl_if() ((control_if_t *)((char *)HYPERVISOR_shared_info + 2048))
#define TX_FULL(_c) \
(((_c)->tx_req_prod - ctrl_if_tx_resp_cons) == CONTROL_RING_SIZE)
@@ -194,34 +191,22 @@ static void __ctrl_if_rx_tasklet(unsigned long data)
{
__insn_barrier();
ctrl_if_rxmsg_deferred_prod = dp;
-#if 0
- wakeup(&ctrl_if_kthread);
-#else
if (ctrl_if_softintr)
softintr_schedule(ctrl_if_softintr);
-#endif
}
}
static int ctrl_if_interrupt(void *arg)
{
- control_if_t *ctrl_if = get_ctrl_if();
+ control_if_t *ctrl_if = get_ctrl_if();
- if ( ctrl_if_tx_resp_cons != ctrl_if->tx_resp_prod ||
- ctrl_if_rx_req_cons != ctrl_if->rx_req_prod ) {
-#if 0
-#if 0
- wakeup(&ctrl_if_kthread);
-#else
- if (ctrl_if_softintr)
- softintr_schedule(ctrl_if_softintr);
-#endif
-#else
- ctrl_if_kthread((void *)1);
-#endif
- }
+ if ( ctrl_if_tx_resp_cons != ctrl_if->tx_resp_prod )
+ __ctrl_if_tx_tasklet(0);
- return 0;
+ if ( ctrl_if_rx_req_cons != ctrl_if->rx_req_prod )
+ __ctrl_if_rx_tasklet(0);
+
+ return 0;
}
int
@@ -289,6 +274,7 @@ ctrl_if_send_message_block(
while ((rc = ctrl_if_send_message_noblock(msg, hnd, id)) == EAGAIN) {
/* XXXcl possible race -> add a lock and ltsleep */
#if 1
+ HYPERVISOR_yield();
#else
rc = tsleep((caddr_t) &ctrl_if_tx_wait, PUSER | PCATCH,
"ctrl_if", 0);
@@ -459,50 +445,16 @@ ctrl_if_unregister_receiver(
restore_flags(flags);
/* Ensure that @hnd will not be executed after this function returns. */
-#if 0
- wakeup(&ctrl_if_kthread);
-#else
if (ctrl_if_softintr)
softintr_schedule(ctrl_if_softintr);
-#endif
-}
-
-static void
-ctrl_if_kthread(void *arg)
-{
- control_if_t *ctrl_if = get_ctrl_if();
-
- for (;;) {
- if ( ctrl_if_tx_resp_cons != ctrl_if->tx_resp_prod )
- __ctrl_if_tx_tasklet(0);
-
- if ( ctrl_if_rx_req_cons != ctrl_if->rx_req_prod )
- __ctrl_if_rx_tasklet(0);
-
- if (arg) {
- // printf("ctrl_if_kthread one-shot done\n");
- return;
- }
-
- tsleep((caddr_t)&ctrl_if_kthread, PUSER | PCATCH,
- "ctrl_if", 0);
- }
}
static void
ctrl_if_softintr_handler(void *arg)
{
- static int in_handler = 0;
-
- if (in_handler++ != 0) {
- ctrl_if_evtchn = -1;
- panic("recurse");
- }
if ( ctrl_if_rxmsg_deferred_cons != ctrl_if_rxmsg_deferred_prod )
__ctrl_if_rxmsg_deferred(NULL);
-
- in_handler--;
}
#ifdef notyet
@@ -545,7 +497,6 @@ void ctrl_if_resume(void)
hypervisor_enable_irq(ctrl_if_irq);
}
-void ctrl_if_early_init(void);
void ctrl_if_early_init(void)
{
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xencons.c b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xencons.c
index 91fbccd9ed..1148951eb7 100644
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xencons.c
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xencons.c
@@ -348,7 +348,6 @@ xencons_rx(ctrl_msg_t *msg, unsigned long id)
ctrl_if_send_response(msg);
}
-void ctrl_if_early_init(void);
void
xenconscn_attach()
{