From 7fc4533b321fbe7ef6ce0ef05e3b99cebe13a39e Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 8 Dec 2005 15:24:02 +0100 Subject: Merge in the newer Xenbus implementation from Linux to the Mini-OS. The new version compiles and starts up, but I'm not really sure how to test the new xenbus implementation. * Added unbind_evtchn * Copied parts of the Linux spinlock implementation to make the changes to xenbus compared to Linux smaller. Also added a dummy rwsem implementation. * Updated the xenbus-files Signed-off-by: Simon Kagstrom --- extras/mini-os/events.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'extras/mini-os/events.c') diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c index adf0afd13e..9201128636 100644 --- a/extras/mini-os/events.c +++ b/extras/mini-os/events.c @@ -56,7 +56,7 @@ int do_event(u32 port, struct pt_regs *regs) } -void bind_evtchn( u32 port, void (*handler)(int, struct pt_regs *) ) +int bind_evtchn( u32 port, void (*handler)(int, struct pt_regs *) ) { if(ev_actions[port].handler) printk("WARN: Handler for port %d already registered, replacing\n", @@ -67,6 +67,16 @@ void bind_evtchn( u32 port, void (*handler)(int, struct pt_regs *) ) /* Finally unmask the port */ unmask_evtchn(port); + + return port; +} + +void unbind_evtchn( u32 port ) +{ + if (!ev_actions[port].handler) + printk("WARN: No handler for port %d when unbinding\n", port); + ev_actions[port].handler = NULL; + ev_actions[port].status |= EVS_DISABLED; } int bind_virq( u32 virq, void (*handler)(int, struct pt_regs *) ) @@ -90,6 +100,10 @@ out: return ret; } +void unbind_virq( u32 port ) +{ + unbind_evtchn(port); +} /* -- cgit v1.2.3