Changeset 466e95f7 in mainline
- Timestamp:
- 2012-10-03T21:08:54Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- faa45c17
- Parents:
- 716185d
- Location:
- kernel/generic
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/sysipc_ops.h
r716185d r466e95f7 37 37 38 38 #include <ipc/ipc.h> 39 40 #define SYSIPC_OP(op, call, ...) \ 41 ({ \ 42 int rc = EOK; \ 43 \ 44 sysipc_ops_t *ops; \ 45 ops = sysipc_ops_get((call)->request_method); \ 46 if (ops->op) \ 47 rc = ops->op((call), ##__VA_ARGS__); \ 48 rc; \ 49 }) 39 50 40 51 /** … … 95 106 * Invoked on: all forgotten calls 96 107 */ 97 void(* request_forget)(call_t *);108 int (* request_forget)(call_t *); 98 109 99 110 /** … … 116 127 * Invoked on: all forgotten calls 117 128 */ 118 void(* answer_cleanup)(call_t *, ipc_data_t *);129 int (* answer_cleanup)(call_t *, ipc_data_t *); 119 130 120 131 /** … … 143 154 144 155 extern int null_request_preprocess(call_t *, phone_t *); 145 extern voidnull_request_forget(call_t *);156 extern int null_request_forget(call_t *); 146 157 extern int null_request_process(call_t *, answerbox_t *); 147 extern voidnull_answer_cleanup(call_t *, ipc_data_t *);158 extern int null_answer_cleanup(call_t *, ipc_data_t *); 148 159 extern int null_answer_preprocess(call_t *, ipc_data_t *); 149 160 extern int null_answer_process(call_t *); -
kernel/generic/src/ipc/ipc.c
r716185d r466e95f7 513 513 irq_spinlock_unlock(&box->lock, true); 514 514 515 if (lst == &box->calls) { 516 sysipc_ops_t *ops; 517 518 ops = sysipc_ops_get(call->request_method); 519 if (ops->request_process) 520 (void) ops->request_process(call, box); 521 } 515 if (lst == &box->calls) 516 SYSIPC_OP(request_process, call, box); 522 517 523 518 ipc_data_t old = call->data; … … 645 640 atomic_dec(&call->caller_phone->active_calls); 646 641 647 sysipc_ops_t *ops = sysipc_ops_get(call->request_method); 648 if (ops->request_forget) 649 ops->request_forget(call); 642 SYSIPC_OP(request_forget, call); 650 643 651 644 ipc_call_release(call); … … 716 709 ASSERT(call->flags & (IPC_CALL_ANSWERED | IPC_CALL_NOTIF)); 717 710 718 sysipc_ops_t *ops = sysipc_ops_get(call->request_method); 719 if (ops->answer_process) 720 ops->answer_process(call); 711 SYSIPC_OP(answer_process, call); 721 712 722 713 ipc_call_free(call); -
kernel/generic/src/ipc/ops/clnestab.c
r716185d r466e95f7 45 45 } 46 46 47 static voidanswer_cleanup(call_t *answer, ipc_data_t *olddata)47 static int answer_cleanup(call_t *answer, ipc_data_t *olddata) 48 48 { 49 49 phone_t *phone = (phone_t *) IPC_GET_ARG5(*olddata); … … 57 57 } 58 58 mutex_unlock(&phone->lock); 59 60 return EOK; 59 61 } 60 62 -
kernel/generic/src/ipc/ops/conctmeto.c
r716185d r466e95f7 54 54 } 55 55 56 static voidrequest_forget(call_t *call)56 static int request_forget(call_t *call) 57 57 { 58 58 phone_dealloc(call->priv); 59 return EOK; 59 60 } 60 61 -
kernel/generic/src/ipc/ops/concttome.c
r716185d r466e95f7 49 49 } 50 50 51 static voidanswer_cleanup(call_t *answer, ipc_data_t *olddata)51 static int answer_cleanup(call_t *answer, ipc_data_t *olddata) 52 52 { 53 53 int phoneid = (int) IPC_GET_ARG5(*olddata); … … 55 55 if (phoneid >= 0) 56 56 phone_dealloc(phoneid); 57 58 return EOK; 57 59 } 58 60 -
kernel/generic/src/ipc/ops/connclone.c
r716185d r466e95f7 97 97 } 98 98 99 static voidanswer_cleanup(call_t *answer, ipc_data_t *olddata)99 static int answer_cleanup(call_t *answer, ipc_data_t *olddata) 100 100 { 101 101 int phoneid = (int) IPC_GET_ARG1(*olddata); … … 116 116 } 117 117 mutex_unlock(&phone->lock); 118 119 return EOK; 118 120 } 119 121 -
kernel/generic/src/ipc/sysipc.c
r716185d r466e95f7 161 161 { 162 162 int rc = EOK; 163 sysipc_ops_t *ops;164 163 165 164 spinlock_lock(&answer->forget_lock); … … 170 169 spinlock_unlock(&answer->forget_lock); 171 170 172 ops = sysipc_ops_get(answer->request_method); 173 if (ops->answer_cleanup) 174 ops->answer_cleanup(answer, olddata); 175 171 SYSIPC_OP(answer_cleanup, answer, olddata); 176 172 return rc; 177 173 } else { … … 213 209 return rc; 214 210 215 ops = sysipc_ops_get(answer->request_method); 216 if (ops->answer_preprocess) 217 rc = ops->answer_preprocess(answer, olddata); 218 219 return rc; 211 return SYSIPC_OP(answer_preprocess, answer, olddata); 220 212 } 221 213 … … 230 222 static int request_preprocess(call_t *call, phone_t *phone) 231 223 { 232 int rc = EOK;233 234 224 call->request_method = IPC_GET_IMETHOD(call->data); 235 236 sysipc_ops_t *ops = sysipc_ops_get(call->request_method); 237 if (ops->request_preprocess) 238 rc = ops->request_preprocess(call, phone); 239 240 return rc; 225 return SYSIPC_OP(request_preprocess, call, phone); 241 226 } 242 227 … … 256 241 IPC_SET_RETVAL(call->data, EFORWARD); 257 242 258 sysipc_ops_t *ops = sysipc_ops_get(call->request_method); 259 if (ops->answer_process) 260 (void) ops->answer_process(call); 243 SYSIPC_OP(answer_process, call); 261 244 } 262 245 … … 273 256 static int process_request(answerbox_t *box, call_t *call) 274 257 { 275 int rc = EOK; 276 277 sysipc_ops_t *ops = sysipc_ops_get(call->request_method); 278 if (ops->request_process) 279 rc = ops->request_process(call, box); 280 281 return rc; 258 return SYSIPC_OP(request_process, call, box); 282 259 } 283 260 -
kernel/generic/src/ipc/sysipc_ops.c
r716185d r466e95f7 76 76 } 77 77 78 voidnull_request_forget(call_t *call)78 int null_request_forget(call_t *call) 79 79 { 80 return EOK; 80 81 } 81 82 … … 85 86 } 86 87 87 voidnull_answer_cleanup(call_t *call, ipc_data_t *data)88 int null_answer_cleanup(call_t *call, ipc_data_t *data) 88 89 { 90 return EOK; 89 91 } 90 92
Note:
See TracChangeset
for help on using the changeset viewer.