Small update to SYS_IRQCTL -> setting an interrupt policy now allows the caller

to provide an index (0 .. 31) that is passed in the HARD_INT message when an
interrupt occurs. The NOTIFY_ARG field contains a bitmap with all indexes for
which an interrupt occured.
This commit is contained in:
Jorrit Herder
2005-07-29 12:44:42 +00:00
parent bd8762263a
commit d62e515660
13 changed files with 45 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ struct priv {
long s_sys_mask; /* allowed kernel calls */
sys_map_t s_notify_pending; /* bit map with pending notifications */
short s_int_pending; /* pending hardware interrupts */
irq_id_t s_int_pending; /* pending hardware interrupts */
sigset_t s_sig_pending; /* pending signals */
timer_t s_alarm_timer; /* synchronous alarm timer */

View File

@@ -248,7 +248,7 @@ irq_hook_t *hook;
* sending the notification message, this bit map will be magically set
* as an argument.
*/
priv(proc_addr(hook->proc_nr))->s_int_pending |= (1 << hook->irq);
priv(proc_addr(hook->proc_nr))->s_int_pending |= (1 << hook->notify_id);
/* Build notification message and return. */
lock_notify(HARDWARE, hook->proc_nr);

View File

@@ -24,6 +24,7 @@ register message *m_ptr; /* pointer to request message */
/* Dismember the request message. */
int irq_vec;
int irq_hook_id;
int notify_id;
int r = OK;
irq_hook_t *hook_ptr;
@@ -65,8 +66,15 @@ register message *m_ptr; /* pointer to request message */
}
if (hook_ptr == NULL) return(ENOSPC);
/* Only caller can request IRQ mappings. Install handler. */
/* When setting a policy, the caller must provide an identifier that
* is returned on the notification message if a interrupt occurs.
*/
notify_id = (unsigned) m_ptr->IRQ_HOOK_ID;
if (notify_id > CHAR_BIT * sizeof(irq_id_t) - 1) return(EINVAL);
/* Install the handler. */
hook_ptr->proc_nr = m_ptr->m_source; /* process to notify */
hook_ptr->notify_id = notify_id; /* identifier to pass */
hook_ptr->policy = m_ptr->IRQ_POLICY; /* policy for interrupts */
put_irq_handler(hook_ptr, irq_vec, generic_handler);

View File

@@ -86,6 +86,7 @@ struct segdesc_s { /* segment descriptor for protected mode */
};
typedef unsigned long irq_policy_t;
typedef unsigned long irq_id_t;
typedef struct irq_hook {
struct irq_hook *next; /* next hook in chain */
@@ -93,6 +94,7 @@ typedef struct irq_hook {
int irq; /* IRQ vector number */
int id; /* id of this hook */
int proc_nr; /* NONE if not in use */
irq_id_t notify_id; /* id to return on interrupt */
irq_policy_t policy; /* bit mask for policy */
} irq_hook_t;