diff options
Diffstat (limited to 'extras/mini-os/events.c')
-rw-r--r-- | extras/mini-os/events.c | 17 |
1 files changed, 17 insertions, 0 deletions
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]; |