Changeset e5f5ce0 in mainline
- Timestamp:
- 2017-09-04T20:25:18Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9e87562
- Parents:
- 431c402
- Location:
- kernel/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/ipc.h
r431c402 re5f5ce0 42 42 #include <abi/proc/task.h> 43 43 #include <typedefs.h> 44 #include <mm/slab.h> 44 45 45 46 struct answerbox; … … 166 167 } call_t; 167 168 169 extern slab_cache_t *phone_slab; 170 168 171 extern answerbox_t *ipc_phone_0; 169 172 -
kernel/generic/src/ipc/ipc.c
r431c402 re5f5ce0 66 66 answerbox_t *ipc_phone_0 = NULL; 67 67 68 static slab_cache_t *ipc_call_slab; 69 static slab_cache_t *ipc_answerbox_slab; 68 static slab_cache_t *call_slab; 69 static slab_cache_t *answerbox_slab; 70 71 slab_cache_t *phone_slab = NULL; 70 72 71 73 /** Initialize a call structure. … … 95 97 if (call->buffer) 96 98 free(call->buffer); 97 slab_free( ipc_call_slab, call);99 slab_free(call_slab, call); 98 100 } 99 101 } … … 112 114 call_t *ipc_call_alloc(unsigned int flags) 113 115 { 114 call_t *call = slab_alloc( ipc_call_slab, flags);116 call_t *call = slab_alloc(call_slab, flags); 115 117 if (call) { 116 118 _ipc_call_init(call); … … 201 203 int ipc_call_sync(phone_t *phone, call_t *request) 202 204 { 203 answerbox_t *mybox = slab_alloc( ipc_answerbox_slab, 0);205 answerbox_t *mybox = slab_alloc(answerbox_slab, 0); 204 206 ipc_answerbox_init(mybox, TASK); 205 207 … … 209 211 int rc = ipc_call(phone, request); 210 212 if (rc != EOK) { 211 slab_free( ipc_answerbox_slab, mybox);213 slab_free(answerbox_slab, mybox); 212 214 return rc; 213 215 } … … 256 258 assert(!answer || request == answer); 257 259 258 slab_free( ipc_answerbox_slab, mybox);260 slab_free(answerbox_slab, mybox); 259 261 return rc; 260 262 } … … 854 856 void ipc_init(void) 855 857 { 856 ipc_call_slab = slab_cache_create("call_t", sizeof(call_t), 0, NULL,858 call_slab = slab_cache_create("call_t", sizeof(call_t), 0, NULL, 857 859 NULL, 0); 858 ipc_answerbox_slab = slab_cache_create("answerbox_t", 859 sizeof(answerbox_t), 0, NULL, NULL, 0); 860 phone_slab = slab_cache_create("phone_t", sizeof(phone_t), 0, NULL, 861 NULL, 0); 862 answerbox_slab = slab_cache_create("answerbox_t", sizeof(answerbox_t), 863 0, NULL, NULL, 0); 860 864 } 861 865 -
kernel/generic/src/ipc/ipcrsc.c
r431c402 re5f5ce0 208 208 int handle = cap_alloc(task); 209 209 if (handle >= 0) { 210 phone_t *phone = malloc(sizeof(phone_t), FRAME_ATOMIC);210 phone_t *phone = slab_alloc(phone_slab, FRAME_ATOMIC); 211 211 if (!phone) { 212 212 cap_free(TASK, handle); … … 248 248 assert(phone->state == IPC_PHONE_CONNECTING); 249 249 250 free(phone);250 slab_free(phone_slab, phone); 251 251 cap_free(TASK, handle); 252 252 }
Note:
See TracChangeset
for help on using the changeset viewer.