Changeset ba81cab in mainline for generic/src/ipc/sysipc.c
- Timestamp:
- 2006-03-18T01:06:13Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fbcfd458
- Parents:
- 81c4c6da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/ipc/sysipc.c
r81c4c6da rba81cab 47 47 * 48 48 */ 49 50 #define GET_CHECK_PHONE(phone,phoneid,err) { \ 51 if (phoneid > IPC_MAX_PHONES) { err; } \ 52 phone = &TASK->phones[phoneid]; \ 53 } 54 49 55 50 56 /** Return true if the method is a system method */ … … 151 157 return EPERM; 152 158 153 phone = get_phone_and_lock(phoneid); 154 if (!phone) 155 return ENOENT; 156 157 ipc_call_init(&call); 159 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 160 161 ipc_call_static_init(&call); 158 162 IPC_SET_METHOD(call.data, method); 159 163 IPC_SET_ARG1(call.data, arg1); … … 173 177 phone_t *phone; 174 178 175 ipc_call_ init(&call);179 ipc_call_static_init(&call); 176 180 copy_from_uspace(&call.data, question, sizeof(call.data)); 177 181 … … 179 183 return EPERM; 180 184 181 phone = get_phone_and_lock(phoneid); 182 if (!phone) 183 return ENOENT; 185 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 184 186 185 187 ipc_call_sync(phone, &call); … … 220 222 return IPC_CALLRET_TEMPORARY; 221 223 222 phone = get_phone_and_lock(phoneid); 223 if (!phone) 224 return IPC_CALLRET_FATAL; 224 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 225 225 226 226 call = ipc_call_alloc(); … … 246 246 return IPC_CALLRET_TEMPORARY; 247 247 248 phone = get_phone_and_lock(phoneid); 249 if (!phone) 250 return IPC_CALLRET_FATAL; 248 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 251 249 252 250 call = ipc_call_alloc(); … … 280 278 return ENOENT; 281 279 282 phone = get_phone_and_lock(phoneid); 283 if (!phone) { 280 GET_CHECK_PHONE(phone, phoneid, { 284 281 IPC_SET_RETVAL(call->data, EFORWARD); 285 282 ipc_answer(&TASK->answerbox, call); 286 283 return ENOENT; 287 } 284 }); 288 285 289 286 if (!is_forwardable(IPC_GET_METHOD(call->data))) { … … 304 301 } 305 302 306 ipc_forward(call, phone ->callee, &TASK->answerbox);303 ipc_forward(call, phone, &TASK->answerbox); 307 304 308 305 return 0; … … 372 369 phone_t *phone; 373 370 374 ipc_call_ init(&call);371 ipc_call_static_init(&call); 375 372 IPC_SET_METHOD(call.data, IPC_M_CONNECTTOME); 376 373 IPC_SET_ARG1(call.data, arg1); 377 374 IPC_SET_ARG2(call.data, arg2); 378 375 379 phone = get_phone_and_lock(phoneid); 380 if (!phone) 381 return ENOENT; 376 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 382 377 383 378 ipc_call_sync(phone, &call); … … 402 397 int newphid; 403 398 404 phone = get_phone_and_lock(phoneid); 405 if (!phone) 406 return ENOENT; 399 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 407 400 408 401 newphid = phone_alloc(); … … 410 403 return ELIMIT; 411 404 412 ipc_call_ init(&call);405 ipc_call_static_init(&call); 413 406 IPC_SET_METHOD(call.data, IPC_M_CONNECTMETO); 414 407 IPC_SET_ARG1(call.data, arg1);
Note:
See TracChangeset
for help on using the changeset viewer.