diff options
Diffstat (limited to 'device/ds_routines.c')
-rw-r--r-- | device/ds_routines.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/device/ds_routines.c b/device/ds_routines.c index 7a5dda5..2b9869a 100644 --- a/device/ds_routines.c +++ b/device/ds_routines.c @@ -87,6 +87,7 @@ #include <device/dev_hdr.h> #include <device/conf.h> #include <device/io_req.h> +#include <device/interrupt.h> #include <device/ds_routines.h> #include <device/net_status.h> #include <device/device_port.h> @@ -332,6 +333,9 @@ experimental_device_intr_register (ipc_port_t master_port, int line, if (master_port != master_device_port) return D_INVALID_OPERATION; + if (receive_port == MACH_PORT_NULL) + return D_INVALID_OPERATION; + /* XXX: move to arch-specific */ if (line < 0 || line >= 16) return D_INVALID_OPERATION; @@ -339,17 +343,8 @@ experimental_device_intr_register (ipc_port_t master_port, int line, ret = insert_intr_entry (line, receive_port, &entry); if (ret) return ret; - // TODO The original port should be replaced - // when the same device driver calls it again, - // in order to handle the case that the device driver crashes and restarts. - ret = install_user_intr_handler (line, flags, entry); - - /* If the port is installed successfully, increase its reference by 1. - * Thus, the port won't be destroyed after its task is terminated. */ - if (ret == 0) - ip_reference (receive_port); - return ret; + return install_user_intr_handler (line, flags, entry); #endif /* MACH_XEN */ } |