Changes in kernel/generic/src/ipc/irq.c [cde999a:c1f68b0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/irq.c
rcde999a rc1f68b0 294 294 /* Free up the IRQ code and associated structures. */ 295 295 code_free(irq->notif_cfg.code); 296 slab_free(irq_ cache, irq);296 slab_free(irq_slab, irq); 297 297 } 298 298 … … 308 308 * @param ucode Uspace pointer to top-half IRQ code. 309 309 * 310 * @param[out] uspace_handle Uspace pointer to IRQ capability handle 311 * 312 * @return Error code. 310 * @return IRQ capability handle. 311 * @return Negative error code. 313 312 * 314 313 */ 315 314 int ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod, 316 irq_code_t *ucode , cap_handle_t *uspace_handle)315 irq_code_t *ucode) 317 316 { 318 317 if ((inr < 0) || (inr > last_inr)) … … 330 329 * Allocate and populate the IRQ kernel object. 331 330 */ 332 cap_handle_t handle; 333 int 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 343 irq_t *irq = (irq_t *) slab_alloc(irq_cache, FRAME_ATOMIC); 331 cap_handle_t handle = cap_alloc(TASK); 332 if (handle < 0) 333 return handle; 334 335 irq_t *irq = (irq_t *) slab_alloc(irq_slab, FRAME_ATOMIC); 344 336 if (!irq) { 345 337 cap_free(TASK, handle); … … 350 342 if (!kobject) { 351 343 cap_free(TASK, handle); 352 slab_free(irq_ cache, irq);344 slab_free(irq_slab, irq); 353 345 return ENOMEM; 354 346 } … … 379 371 cap_publish(TASK, handle, kobject); 380 372 381 return EOK;373 return handle; 382 374 } 383 375 … … 387 379 * @param handle IRQ capability handle. 388 380 * 389 * @return EOK on success or a nerror code.381 * @return EOK on success or a negative error code. 390 382 * 391 383 */
Note:
See TracChangeset
for help on using the changeset viewer.