xref: /minix3/minix/lib/libsys/sys_irqctl.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include "syslib.h"
2*433d6423SLionel Sambuc 
3*433d6423SLionel Sambuc /*===========================================================================*
4*433d6423SLionel Sambuc  *                               sys_irqctl				     *
5*433d6423SLionel Sambuc  *===========================================================================*/
sys_irqctl(req,irq_vec,policy,hook_id)6*433d6423SLionel Sambuc int sys_irqctl(req, irq_vec, policy, hook_id)
7*433d6423SLionel Sambuc int req;				/* IRQ control request */
8*433d6423SLionel Sambuc int irq_vec;				/* IRQ vector to control */
9*433d6423SLionel Sambuc int policy;				/* bit mask for policy flags */
10*433d6423SLionel Sambuc int *hook_id;				/* ID of IRQ hook at kernel */
11*433d6423SLionel Sambuc {
12*433d6423SLionel Sambuc     message m_irq;
13*433d6423SLionel Sambuc     int s;
14*433d6423SLionel Sambuc 
15*433d6423SLionel Sambuc     m_irq.m_type = SYS_IRQCTL;
16*433d6423SLionel Sambuc     m_irq.m_lsys_krn_sys_irqctl.request = req;
17*433d6423SLionel Sambuc     m_irq.m_lsys_krn_sys_irqctl.vector = irq_vec;
18*433d6423SLionel Sambuc     m_irq.m_lsys_krn_sys_irqctl.policy = policy;
19*433d6423SLionel Sambuc     m_irq.m_lsys_krn_sys_irqctl.hook_id = *hook_id;
20*433d6423SLionel Sambuc 
21*433d6423SLionel Sambuc     s = _kernel_call(SYS_IRQCTL, &m_irq);
22*433d6423SLionel Sambuc     if (req == IRQ_SETPOLICY) *hook_id = m_irq.m_krn_lsys_sys_irqctl.hook_id;
23*433d6423SLionel Sambuc     return(s);
24*433d6423SLionel Sambuc }
25