Rev 1591 | Rev 1669 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1591 | Rev 1595 | ||
---|---|---|---|
Line 551... | Line 551... | ||
551 | } |
551 | } |
552 | return (__native)call; |
552 | return (__native)call; |
553 | } |
553 | } |
554 | 554 | ||
555 | /** Connect irq handler to task */ |
555 | /** Connect irq handler to task */ |
556 | __native sys_ipc_register_irq(__native irq, irq_code_t *ucode) |
556 | __native sys_ipc_register_irq(int irq, irq_code_t *ucode) |
557 | { |
557 | { |
558 | if (!(cap_get(TASK) & CAP_IRQ_REG)) |
558 | if (!(cap_get(TASK) & CAP_IRQ_REG)) |
559 | return EPERM; |
559 | return EPERM; |
560 | 560 | ||
561 | if (irq >= IRQ_COUNT) |
561 | if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL) |
562 | return (__native) ELIMIT; |
562 | return (__native) ELIMIT; |
563 | 563 | ||
564 | irq_ipc_bind_arch(irq); |
564 | irq_ipc_bind_arch(irq); |
565 | 565 | ||
566 | return ipc_irq_register(&TASK->answerbox, irq, ucode); |
566 | return ipc_irq_register(&TASK->answerbox, irq, ucode); |
567 | } |
567 | } |
568 | 568 | ||
569 | /* Disconnect irq handler from task */ |
569 | /* Disconnect irq handler from task */ |
570 | __native sys_ipc_unregister_irq(__native irq) |
570 | __native sys_ipc_unregister_irq(int irq) |
571 | { |
571 | { |
572 | if (!(cap_get(TASK) & CAP_IRQ_REG)) |
572 | if (!(cap_get(TASK) & CAP_IRQ_REG)) |
573 | return EPERM; |
573 | return EPERM; |
574 | 574 | ||
575 | if (irq >= IRQ_COUNT) |
575 | if (irq >= IRQ_COUNT || irq <= -IPC_IRQ_RESERVED_VIRTUAL) |
576 | return (__native) ELIMIT; |
576 | return (__native) ELIMIT; |
577 | 577 | ||
578 | ipc_irq_unregister(&TASK->answerbox, irq); |
578 | ipc_irq_unregister(&TASK->answerbox, irq); |
579 | 579 | ||
580 | return 0; |
580 | return 0; |