Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 04cb68f2 in mainline for kernel/generic/src/ddi/ddi.c


Ignore:
Timestamp:
2010-10-20T19:30:54Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial
Children:
78a9e5ef
Parents:
e0e568ff (diff), a6e54c5d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~helenos-dd/helenos/dd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ddi/ddi.c

    re0e568ff r04cb68f2  
    258258}
    259259
     260/** Disable or enable specified interrupts.
     261 *
     262 * @param irq the interrupt to be enabled/disabled.
     263 * @param enable if true enable the interrupt, disable otherwise.
     264 *
     265 * @retutn Zero on success, error code otherwise.
     266 */
     267unative_t sys_interrupt_enable(int irq, int enable)
     268{       
     269        cap_t task_cap = cap_get(TASK);
     270        if (!(task_cap & CAP_IRQ_REG))
     271                return EPERM;
     272               
     273        if (irq < 0 || irq > 16) {
     274                return EINVAL;
     275        }
     276       
     277        uint16_t irq_mask = (uint16_t)(1 << irq);
     278        if (enable) {
     279                trap_virtual_enable_irqs(irq_mask);
     280        } else {
     281                trap_virtual_disable_irqs(irq_mask);
     282        }
     283       
     284        return 0;       
     285}
     286
    260287/** @}
    261288 */
Note: See TracChangeset for help on using the changeset viewer.