Changeset 9233e9d in mainline for kernel/generic/src/ipc/irq.c


Ignore:
Timestamp:
2017-12-08T21:17:27Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
071a1ddb
Parents:
6deb2cd
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 16:48:51)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:17:27)
Message:

Return capability handle in SYS_IPC_IRQ_SUBSCRIBE separately from error code.

File:
1 edited

Legend:

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

    r6deb2cd r9233e9d  
    308308 * @param ucode   Uspace pointer to top-half IRQ code.
    309309 *
    310  * @return  IRQ capability handle.
    311  * @return  Negative error code.
     310 * @param[out] uspace_handle  Uspace pointer to IRQ capability handle
     311 *
     312 * @return  Error code.
    312313 *
    313314 */
    314315int ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
    315     irq_code_t *ucode)
     316    irq_code_t *ucode, cap_handle_t *uspace_handle)
    316317{
    317318        if ((inr < 0) || (inr > last_inr))
     
    333334                return handle;
    334335       
     336        int rc = copy_to_uspace(uspace_handle, &handle, sizeof(cap_handle_t));
     337        if (rc != EOK) {
     338                cap_free(TASK, handle);
     339                return rc;
     340        }
     341
    335342        irq_t *irq = (irq_t *) slab_alloc(irq_cache, FRAME_ATOMIC);
    336343        if (!irq) {
     
    371378        cap_publish(TASK, handle, kobject);
    372379       
    373         return handle;
     380        return EOK;
    374381}
    375382
Note: See TracChangeset for help on using the changeset viewer.