Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/irq.c

    r78ffb70 r1d432f9  
    4242 *
    4343 * The structure of a notification message is as follows:
    44  * - IMETHOD: interface and method as registered by the SYS_IPC_REGISTER_IRQ
    45  *            syscall
     44 * - METHOD: method as registered by the SYS_IPC_REGISTER_IRQ syscall
    4645 * - ARG1: payload modified by a 'top-half' handler
    4746 * - ARG2: payload modified by a 'top-half' handler
     
    5049 * - ARG5: payload modified by a 'top-half' handler
    5150 * - in_phone_hash: interrupt counter (may be needed to assure correct order
    52  *                  in multithreaded drivers)
     51 *         in multithreaded drivers)
    5352 *
    5453 * Note on synchronization for ipc_irq_register(), ipc_irq_unregister(),
     
    131130/** Register an answerbox as a receiving end for IRQ notifications.
    132131 *
    133  * @param box           Receiving answerbox.
    134  * @param inr           IRQ number.
    135  * @param devno         Device number.
    136  * @param imethod       Interface and method to be associated with the
    137  *                      notification.
    138  * @param ucode         Uspace pointer to top-half pseudocode.
    139  * @return              EOK on success or a negative error code.
     132 * @param box    Receiving answerbox.
     133 * @param inr    IRQ number.
     134 * @param devno  Device number.
     135 * @param method Method to be associated with the notification.
     136 * @param ucode  Uspace pointer to top-half pseudocode.
     137 *
     138 * @return EBADMEM, ENOENT or EEXISTS on failure or 0 on success.
    140139 *
    141140 */
    142141int ipc_irq_register(answerbox_t *box, inr_t inr, devno_t devno,
    143     sysarg_t imethod, irq_code_t *ucode)
    144 {
    145         sysarg_t key[] = {
    146                 (sysarg_t) inr,
    147                 (sysarg_t) devno
     142    unative_t method, irq_code_t *ucode)
     143{
     144        unative_t key[] = {
     145                (unative_t) inr,
     146                (unative_t) devno
    148147        };
    149 
    150         if ((inr < 0) || (inr > last_inr))
    151                 return ELIMIT;
    152148       
    153149        irq_code_t *code;
     
    171167        irq->notif_cfg.notify = true;
    172168        irq->notif_cfg.answerbox = box;
    173         irq->notif_cfg.imethod = imethod;
     169        irq->notif_cfg.method = method;
    174170        irq->notif_cfg.code = code;
    175171        irq->notif_cfg.counter = 0;
     
    210206/** Unregister task from IRQ notification.
    211207 *
    212  * @param box           Answerbox associated with the notification.
    213  * @param inr           IRQ number.
    214  * @param devno         Device number.
    215  * @return              EOK on success or a negative error code.
     208 * @param box   Answerbox associated with the notification.
     209 * @param inr   IRQ number.
     210 * @param devno Device number.
     211 *
    216212 */
    217213int ipc_irq_unregister(answerbox_t *box, inr_t inr, devno_t devno)
    218214{
    219         sysarg_t key[] = {
    220                 (sysarg_t) inr,
    221                 (sysarg_t) devno
     215        unative_t key[] = {
     216                (unative_t) inr,
     217                (unative_t) devno
    222218        };
    223 
    224         if ((inr < 0) || (inr > last_inr))
    225                 return ELIMIT;
    226219       
    227220        irq_spinlock_lock(&irq_uspace_hash_table_lock, true);
     
    297290                }
    298291               
    299                 sysarg_t key[2];
     292                unative_t key[2];
    300293                key[0] = irq->inr;
    301294                key[1] = irq->devno;
     
    451444               
    452445                /* Set up args */
    453                 IPC_SET_IMETHOD(call->data, irq->notif_cfg.imethod);
     446                IPC_SET_METHOD(call->data, irq->notif_cfg.method);
    454447                IPC_SET_ARG1(call->data, irq->notif_cfg.scratch[1]);
    455448                IPC_SET_ARG2(call->data, irq->notif_cfg.scratch[2]);
     
    472465 *
    473466 */
    474 void ipc_irq_send_msg(irq_t *irq, sysarg_t a1, sysarg_t a2, sysarg_t a3,
    475     sysarg_t a4, sysarg_t a5)
     467void ipc_irq_send_msg(irq_t *irq, unative_t a1, unative_t a2, unative_t a3,
     468    unative_t a4, unative_t a5)
    476469{
    477470        irq_spinlock_lock(&irq->lock, true);
     
    488481                call->priv = ++irq->notif_cfg.counter;
    489482               
    490                 IPC_SET_IMETHOD(call->data, irq->notif_cfg.imethod);
     483                IPC_SET_METHOD(call->data, irq->notif_cfg.method);
    491484                IPC_SET_ARG1(call->data, a1);
    492485                IPC_SET_ARG2(call->data, a2);
Note: See TracChangeset for help on using the changeset viewer.