Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 63d8f43 in mainline for kernel/generic/src/ipc/irq.c


Ignore:
Timestamp:
2017-09-04T19:38:28Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
fa32c9f
Parents:
30c27e9
Message:

Allocate the kobjects referenced by capabilities dynamically

File:
1 edited

Legend:

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

    r30c27e9 r63d8f43  
    307307        if (handle < 0)
    308308                return handle;
     309       
     310        irq_t *irq = (irq_t *) malloc(sizeof(irq_t), FRAME_ATOMIC);
     311        if (!irq) {
     312                cap_free(TASK, handle);
     313                return ENOMEM;
     314        }
     315       
    309316        cap_t *cap = cap_get_current(handle, CAP_TYPE_ALLOCATED);
    310317        assert(cap);
    311318       
    312         irq_t *irq = &cap->irq;
    313319        irq_initialize(irq);
    314320        irq->inr = inr;
     
    321327        irq->notif_cfg.counter = 0;
    322328       
     329        cap->kobject = (void *) irq;
     330       
    323331        /*
    324332         * Insert the IRQ structure into the uspace IRQ hash table and retype
     
    359367        irq_spinlock_unlock(&TASK->lock, true);
    360368       
    361         irq_t *irq = &cap->irq;
     369        irq_t *irq = (irq_t *) cap->kobject;
    362370       
    363371        irq_spinlock_lock(&irq_uspace_hash_table_lock, true);
     
    376384       
    377385        /* Free up the IRQ capability and the underlying kernel object. */
     386        free(cap->kobject);
    378387        cap_free(TASK, handle);
    379388       
Note: See TracChangeset for help on using the changeset viewer.