aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2007-11-23 16:25:59 +0000
committerKeir Fraser <keir.fraser@citrix.com>2007-11-23 16:25:59 +0000
commit9ebc5c7ea6e855d71d75b985c4a9ed6cc9f353e2 (patch)
treebbdde8340db924fd70540cc7c6d4f41ddfccb3dd
parentfd2f80c255acc5edf0cea58053c81f392042bf51 (diff)
downloadxen-9ebc5c7ea6e855d71d75b985c4a9ed6cc9f353e2.tar.gz
xen-9ebc5c7ea6e855d71d75b985c4a9ed6cc9f353e2.tar.bz2
xen-9ebc5c7ea6e855d71d75b985c4a9ed6cc9f353e2.zip
[Mini-OS] Make bind_virq return the port
Make bind_virq() return the port bound to the irq, which is useful e.g. for masking/unmasking it. Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
-rw-r--r--extras/mini-os/arch/ia64/time.c2
-rw-r--r--extras/mini-os/events.c6
-rw-r--r--extras/mini-os/include/events.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/extras/mini-os/arch/ia64/time.c b/extras/mini-os/arch/ia64/time.c
index 2d943e8c7a..e000ced098 100644
--- a/extras/mini-os/arch/ia64/time.c
+++ b/extras/mini-os/arch/ia64/time.c
@@ -267,7 +267,7 @@ init_time(void)
printk("efi_get_time() failed\n");
err = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
- if (err != 0) {
+ if (err == -1) {
printk("XEN timer request chn bind failed %i\n", err);
return;
}
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index dad8e42377..9174f166ed 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -102,7 +102,7 @@ void unbind_evtchn(evtchn_port_t port )
ev_actions[port].data = NULL;
}
-int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
+evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
{
evtchn_bind_virq_t op;
@@ -113,11 +113,11 @@ int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
{
printk("Failed to bind virtual IRQ %d\n", virq);
- return 1;
+ return -1;
}
set_bit(op.port,bound_ports);
bind_evtchn(op.port, handler, data);
- return 0;
+ return op.port;
}
#if defined(__x86_64__)
diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h
index 5cc9fa8a9f..ff202e38fe 100644
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -26,7 +26,7 @@ typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *);
/* prototypes */
int do_event(evtchn_port_t port, struct pt_regs *regs);
-int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
+evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
evtchn_port_t bind_evtchn(evtchn_port_t port, evtchn_handler_t handler,
void *data);
void unbind_evtchn(evtchn_port_t port);