Changes in kernel/generic/src/ipc/irq.c [8add9ca5:1d432f9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/irq.c
r8add9ca5 r1d432f9 42 42 * 43 43 * The structure of a notification message is as follows: 44 * - IMETHOD: interface and method as registered by the SYS_REGISTER_IRQ 45 * syscall 44 * - METHOD: method as registered by the SYS_IPC_REGISTER_IRQ syscall 46 45 * - ARG1: payload modified by a 'top-half' handler 47 46 * - ARG2: payload modified by a 'top-half' handler … … 50 49 * - ARG5: payload modified by a 'top-half' handler 51 50 * - in_phone_hash: interrupt counter (may be needed to assure correct order 52 * 51 * in multithreaded drivers) 53 52 * 54 53 * Note on synchronization for ipc_irq_register(), ipc_irq_unregister(), … … 131 130 /** Register an answerbox as a receiving end for IRQ notifications. 132 131 * 133 * @param box 134 * @param inr 135 * @param devno 136 * @param imethod Interface and method to be associated with the137 * 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. 140 139 * 141 140 */ 142 141 int 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) devno142 unative_t method, irq_code_t *ucode) 143 { 144 unative_t key[] = { 145 (unative_t) inr, 146 (unative_t) devno 148 147 }; 149 150 if ((inr < 0) || (inr > last_inr))151 return ELIMIT;152 148 153 149 irq_code_t *code; … … 171 167 irq->notif_cfg.notify = true; 172 168 irq->notif_cfg.answerbox = box; 173 irq->notif_cfg. imethod = imethod;169 irq->notif_cfg.method = method; 174 170 irq->notif_cfg.code = code; 175 171 irq->notif_cfg.counter = 0; … … 210 206 /** Unregister task from IRQ notification. 211 207 * 212 * @param box 213 * @param inr 214 * @param devno 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 * 216 212 */ 217 213 int ipc_irq_unregister(answerbox_t *box, inr_t inr, devno_t devno) 218 214 { 219 sysarg_t key[] = {220 ( sysarg_t) inr,221 ( sysarg_t) devno215 unative_t key[] = { 216 (unative_t) inr, 217 (unative_t) devno 222 218 }; 223 224 if ((inr < 0) || (inr > last_inr))225 return ELIMIT;226 219 227 220 irq_spinlock_lock(&irq_uspace_hash_table_lock, true); … … 297 290 } 298 291 299 sysarg_t key[2];292 unative_t key[2]; 300 293 key[0] = irq->inr; 301 294 key[1] = irq->devno; … … 404 397 (uint32_t) code->cmds[i].value); 405 398 break; 406 case CMD_PIO_WRITE_A_8:407 if (srcarg) {408 pio_write_8((ioport8_t *) code->cmds[i].addr,409 (uint8_t) scratch[srcarg]);410 }411 break;412 case CMD_PIO_WRITE_A_16:413 if (srcarg) {414 pio_write_16((ioport16_t *) code->cmds[i].addr,415 (uint16_t) scratch[srcarg]);416 }417 break;418 case CMD_PIO_WRITE_A_32:419 if (srcarg) {420 pio_write_32((ioport32_t *) code->cmds[i].addr,421 (uint32_t) scratch[srcarg]);422 }423 break;424 399 case CMD_BTEST: 425 400 if ((srcarg) && (dstarg)) { … … 469 444 470 445 /* Set up args */ 471 IPC_SET_ IMETHOD(call->data, irq->notif_cfg.imethod);446 IPC_SET_METHOD(call->data, irq->notif_cfg.method); 472 447 IPC_SET_ARG1(call->data, irq->notif_cfg.scratch[1]); 473 448 IPC_SET_ARG2(call->data, irq->notif_cfg.scratch[2]); … … 490 465 * 491 466 */ 492 void ipc_irq_send_msg(irq_t *irq, sysarg_t a1, sysarg_t a2, sysarg_t a3,493 sysarg_t a4, sysarg_t a5)467 void ipc_irq_send_msg(irq_t *irq, unative_t a1, unative_t a2, unative_t a3, 468 unative_t a4, unative_t a5) 494 469 { 495 470 irq_spinlock_lock(&irq->lock, true); … … 506 481 call->priv = ++irq->notif_cfg.counter; 507 482 508 IPC_SET_ IMETHOD(call->data, irq->notif_cfg.imethod);483 IPC_SET_METHOD(call->data, irq->notif_cfg.method); 509 484 IPC_SET_ARG1(call->data, a1); 510 485 IPC_SET_ARG2(call->data, a2);
Note:
See TracChangeset
for help on using the changeset viewer.