Ignore:
File:
1 edited

Legend:

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

    rb7fd2a0 r82d515e9  
    7878}
    7979
    80 static errno_t ranges_map_and_apply(irq_pio_range_t *ranges, size_t rangecount,
     80static int ranges_map_and_apply(irq_pio_range_t *ranges, size_t rangecount,
    8181    irq_cmd_t *cmds, size_t cmdcount)
    8282{
     
    164164 *
    165165 */
    166 static errno_t code_check(irq_cmd_t *cmds, size_t cmdcount)
     166static int code_check(irq_cmd_t *cmds, size_t cmdcount)
    167167{
    168168        for (size_t i = 0; i < cmdcount; i++) {
     
    226226       
    227227        irq_code_t *code = malloc(sizeof(*code), 0);
    228         errno_t rc = copy_from_uspace(code, ucode, sizeof(*code));
     228        int rc = copy_from_uspace(code, ucode, sizeof(*code));
    229229        if (rc != EOK)
    230230                goto error;
     
    308308 * @param ucode   Uspace pointer to top-half IRQ code.
    309309 *
    310  * @param[out] uspace_handle  Uspace pointer to IRQ capability handle
    311  *
    312  * @return  Error code.
    313  *
    314  */
    315 errno_t ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
    316     irq_code_t *ucode, cap_handle_t *uspace_handle)
     310 * @return  IRQ capability handle.
     311 * @return  Negative error code.
     312 *
     313 */
     314int ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
     315    irq_code_t *ucode)
    317316{
    318317        if ((inr < 0) || (inr > last_inr))
     
    330329         * Allocate and populate the IRQ kernel object.
    331330         */
    332         cap_handle_t handle;
    333         errno_t rc = cap_alloc(TASK, &handle);
    334         if (rc != EOK)
    335                 return rc;
    336        
    337         rc = copy_to_uspace(uspace_handle, &handle, sizeof(cap_handle_t));
    338         if (rc != EOK) {
    339                 cap_free(TASK, handle);
    340                 return rc;
    341         }
    342 
     331        cap_handle_t handle = cap_alloc(TASK);
     332        if (handle < 0)
     333                return handle;
     334       
    343335        irq_t *irq = (irq_t *) slab_alloc(irq_cache, FRAME_ATOMIC);
    344336        if (!irq) {
     
    379371        cap_publish(TASK, handle, kobject);
    380372       
    381         return EOK;
     373        return handle;
    382374}
    383375
     
    387379 * @param handle  IRQ capability handle.
    388380 *
    389  * @return EOK on success or an error code.
    390  *
    391  */
    392 errno_t ipc_irq_unsubscribe(answerbox_t *box, int handle)
     381 * @return EOK on success or a negative error code.
     382 *
     383 */
     384int ipc_irq_unsubscribe(answerbox_t *box, int handle)
    393385{
    394386        kobject_t *kobj = cap_unpublish(TASK, handle, KOBJECT_TYPE_IRQ);
Note: See TracChangeset for help on using the changeset viewer.