diff options
-rw-r--r-- | device/intr.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/device/intr.c b/device/intr.c index 1e5a3ea..b0dcd83 100644 --- a/device/intr.c +++ b/device/intr.c @@ -10,8 +10,6 @@ #define sti() __asm__ __volatile__ ("sti": : :"memory") #define cli() __asm__ __volatile__ ("cli": : :"memory") -static boolean_t deliver_intr (int line, ipc_port_t dest_port); - struct intr_entry { queue_chain_t chain; @@ -112,6 +110,33 @@ init_mach_intr_notification (mach_intr_notification_t *n) t->msgt_unused = 0; } +static boolean_t +deliver_intr (int line, ipc_port_t dest_port) +{ + ipc_kmsg_t kmsg; + mach_intr_notification_t *n; + mach_port_t dest = (mach_port_t) dest_port; + + if (dest == MACH_PORT_NULL) + return FALSE; + + kmsg = ikm_alloc(sizeof *n); + if (kmsg == IKM_NULL) + return FALSE; + + ikm_init(kmsg, sizeof *n); + n = (mach_intr_notification_t *) &kmsg->ikm_header; + *n = mach_intr_notification_template; + + n->intr_header.msgh_remote_port = dest; + n->line = line; + + ipc_port_copy_send (dest_port); + ipc_mqueue_send_always(kmsg); + + return TRUE; +} + void intr_thread () { @@ -167,30 +192,4 @@ intr_thread () } } -static boolean_t -deliver_intr (int line, ipc_port_t dest_port) -{ - ipc_kmsg_t kmsg; - mach_intr_notification_t *n; - mach_port_t dest = (mach_port_t) dest_port; - - if (dest == MACH_PORT_NULL) - return FALSE; - - kmsg = ikm_alloc(sizeof *n); - if (kmsg == IKM_NULL) - return FALSE; - - ikm_init(kmsg, sizeof *n); - n = (mach_intr_notification_t *) &kmsg->ikm_header; - *n = mach_intr_notification_template; - - n->intr_header.msgh_remote_port = dest; - n->line = line; - - ipc_port_copy_send (dest_port); - ipc_mqueue_send_always(kmsg); - - return TRUE; -} #endif /* MACH_XEN */ |