Changes in kernel/generic/src/cap/cap.c [fc0de8c:5e801dc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
rfc0de8c r5e801dc 83 83 #include <mm/slab.h> 84 84 #include <adt/list.h> 85 #include <synch/syswaitq.h>86 #include <ipc/ipcrsc.h>87 #include <ipc/ipc.h>88 #include <ipc/irq.h>89 85 90 86 #include <limits.h> … … 92 88 #include <stdlib.h> 93 89 94 #define CAPS_START ( (intptr_t)CAP_NIL + 1)95 #define CAPS_SIZE (INT_MAX - (int)CAPS_START)90 #define CAPS_START (CAP_NIL + 1) 91 #define CAPS_SIZE (INT_MAX - CAPS_START) 96 92 #define CAPS_LAST (CAPS_SIZE - 1) 97 93 98 94 static slab_cache_t *cap_cache; 99 95 static slab_cache_t *kobject_cache; 100 101 kobject_ops_t *kobject_ops[KOBJECT_TYPE_MAX] = {102 [KOBJECT_TYPE_CALL] = &call_kobject_ops,103 [KOBJECT_TYPE_IRQ] = &irq_kobject_ops,104 [KOBJECT_TYPE_PHONE] = &phone_kobject_ops,105 [KOBJECT_TYPE_WAITQ] = &waitq_kobject_ops106 };107 96 108 97 static size_t caps_hash(const ht_link_t *item) … … 423 412 * @param type Type of the kernel object. 424 413 * @param raw Raw pointer to the encapsulated object. 425 */ 426 void kobject_initialize(kobject_t *kobj, kobject_type_t type, void *raw) 414 * @param ops Pointer to kernel object operations for the respective type. 415 */ 416 void kobject_initialize(kobject_t *kobj, kobject_type_t type, void *raw, 417 kobject_ops_t *ops) 427 418 { 428 419 atomic_store(&kobj->refcnt, 1); … … 433 424 kobj->type = type; 434 425 kobj->raw = raw; 426 kobj->ops = ops; 435 427 } 436 428 … … 482 474 { 483 475 if (atomic_postdec(&kobj->refcnt) == 1) { 484 KOBJECT_OP(kobj)->destroy(kobj->raw);476 kobj->ops->destroy(kobj->raw); 485 477 kobject_free(kobj); 486 478 }
Note:
See TracChangeset
for help on using the changeset viewer.