From 38cfc3b8d0bcfd2250bafa8efe1714f1b522d3fc Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 2 Jul 2008 17:26:42 +0100 Subject: minios: PIRQ and MSI/MSI-X support Signed-off-by: Samuel Thibault --- extras/mini-os/events.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'extras/mini-os/events.c') diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c index 87f54ef5eb..e89d7478fa 100644 --- a/extras/mini-os/events.c +++ b/extras/mini-os/events.c @@ -136,6 +136,23 @@ evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data) return op.port; } +evtchn_port_t bind_pirq(uint32_t pirq, int will_share, evtchn_handler_t handler, void *data) +{ + evtchn_bind_pirq_t op; + + /* Try to bind the pirq to a port */ + op.pirq = pirq; + op.flags = will_share ? BIND_PIRQ__WILL_SHARE : 0; + + if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &op) != 0 ) + { + printk("Failed to bind physical IRQ %d\n", pirq); + return -1; + } + bind_evtchn(op.port, handler, data); + return op.port; +} + #if defined(__x86_64__) char irqstack[2 * STACK_SIZE]; -- cgit v1.2.3