Changeset 82d515e9 in mainline for kernel/generic/src/ipc
- Timestamp:
- 2017-12-05T11:30:02Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9af1c61
- Parents:
- 9a09212
- git-author:
- Jakub Jermar <jakub@…> (2017-12-05 11:25:41)
- git-committer:
- Jakub Jermar <jakub@…> (2017-12-05 11:30:02)
- Location:
- kernel/generic/src/ipc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
r9a09212 r82d515e9 66 66 answerbox_t *ipc_phone_0 = NULL; 67 67 68 static slab_cache_t *call_ slab;69 static slab_cache_t *answerbox_ slab;70 71 slab_cache_t *phone_ slab= NULL;68 static slab_cache_t *call_cache; 69 static slab_cache_t *answerbox_cache; 70 71 slab_cache_t *phone_cache = NULL; 72 72 73 73 /** Initialize a call structure. … … 95 95 if (call->caller_phone) 96 96 kobject_put(call->caller_phone->kobject); 97 slab_free(call_ slab, call);97 slab_free(call_cache, call); 98 98 } 99 99 … … 115 115 call_t *ipc_call_alloc(unsigned int flags) 116 116 { 117 call_t *call = slab_alloc(call_ slab, flags);117 call_t *call = slab_alloc(call_cache, flags); 118 118 if (!call) 119 119 return NULL; 120 120 kobject_t *kobj = (kobject_t *) malloc(sizeof(kobject_t), flags); 121 121 if (!kobj) { 122 slab_free(call_ slab, call);122 slab_free(call_cache, call); 123 123 return NULL; 124 124 } … … 210 210 int ipc_call_sync(phone_t *phone, call_t *request) 211 211 { 212 answerbox_t *mybox = slab_alloc(answerbox_ slab, 0);212 answerbox_t *mybox = slab_alloc(answerbox_cache, 0); 213 213 ipc_answerbox_init(mybox, TASK); 214 214 … … 218 218 int rc = ipc_call(phone, request); 219 219 if (rc != EOK) { 220 slab_free(answerbox_ slab, mybox);220 slab_free(answerbox_cache, mybox); 221 221 return rc; 222 222 } … … 265 265 assert(!answer || request == answer); 266 266 267 slab_free(answerbox_ slab, mybox);267 slab_free(answerbox_cache, mybox); 268 268 return rc; 269 269 } … … 906 906 void ipc_init(void) 907 907 { 908 call_ slab= slab_cache_create("call_t", sizeof(call_t), 0, NULL,908 call_cache = slab_cache_create("call_t", sizeof(call_t), 0, NULL, 909 909 NULL, 0); 910 phone_ slab= slab_cache_create("phone_t", sizeof(phone_t), 0, NULL,910 phone_cache = slab_cache_create("phone_t", sizeof(phone_t), 0, NULL, 911 911 NULL, 0); 912 answerbox_ slab= slab_cache_create("answerbox_t", sizeof(answerbox_t),912 answerbox_cache = slab_cache_create("answerbox_t", sizeof(answerbox_t), 913 913 0, NULL, NULL, 0); 914 914 } -
kernel/generic/src/ipc/ipcrsc.c
r9a09212 r82d515e9 153 153 { 154 154 phone_t *phone = (phone_t *) arg; 155 slab_free(phone_ slab, phone);155 slab_free(phone_cache, phone); 156 156 } 157 157 … … 173 173 cap_handle_t handle = cap_alloc(task); 174 174 if (handle >= 0) { 175 phone_t *phone = slab_alloc(phone_ slab, FRAME_ATOMIC);175 phone_t *phone = slab_alloc(phone_cache, FRAME_ATOMIC); 176 176 if (!phone) { 177 177 cap_free(TASK, handle); … … 181 181 if (!kobject) { 182 182 cap_free(TASK, handle); 183 slab_free(phone_ slab, phone);183 slab_free(phone_cache, phone); 184 184 return ENOMEM; 185 185 } -
kernel/generic/src/ipc/irq.c
r9a09212 r82d515e9 294 294 /* Free up the IRQ code and associated structures. */ 295 295 code_free(irq->notif_cfg.code); 296 slab_free(irq_ slab, irq);296 slab_free(irq_cache, irq); 297 297 } 298 298 … … 333 333 return handle; 334 334 335 irq_t *irq = (irq_t *) slab_alloc(irq_ slab, FRAME_ATOMIC);335 irq_t *irq = (irq_t *) slab_alloc(irq_cache, FRAME_ATOMIC); 336 336 if (!irq) { 337 337 cap_free(TASK, handle); … … 342 342 if (!kobject) { 343 343 cap_free(TASK, handle); 344 slab_free(irq_ slab, irq);344 slab_free(irq_cache, irq); 345 345 return ENOMEM; 346 346 }
Note:
See TracChangeset
for help on using the changeset viewer.