Changeset 3209923 in mainline
- Timestamp:
- 2007-11-20T09:12:49Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b74959bd
- Parents:
- bc50fc42
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/sysipc.h
rbc50fc42 r3209923 45 45 ipc_data_t *reply); 46 46 unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, 47 unative_t arg1, unative_t arg2 );48 unative_t sys_ipc_call_async (unative_t phoneid, ipc_data_t *data);47 unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4); 48 unative_t sys_ipc_call_async_slow(unative_t phoneid, ipc_data_t *data); 49 49 unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, 50 50 unative_t arg1, unative_t arg2); -
kernel/generic/include/syscall/syscall.h
rbc50fc42 r3209923 51 51 SYS_IPC_CALL_SYNC_SLOW, 52 52 SYS_IPC_CALL_ASYNC_FAST, 53 SYS_IPC_CALL_ASYNC ,53 SYS_IPC_CALL_ASYNC_SLOW, 54 54 SYS_IPC_ANSWER_FAST, 55 55 SYS_IPC_ANSWER, -
kernel/generic/src/ipc/sysipc.c
rbc50fc42 r3209923 445 445 /** Make a fast asynchronous call over IPC. 446 446 * 447 * This function can only handle twoarguments of payload, but is faster than448 * the generic function sys_ipc_call_async ().447 * This function can only handle four arguments of payload, but is faster than 448 * the generic function sys_ipc_call_async_slow(). 449 449 * 450 450 * @param phoneid Phone handle for the call. … … 452 452 * @param arg1 Service-defined payload argument. 453 453 * @param arg2 Service-defined payload argument. 454 * @param arg3 Service-defined payload argument. 455 * @param arg4 Service-defined payload argument. 454 456 * 455 457 * @return Return call hash on success. … … 459 461 */ 460 462 unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, 461 unative_t arg1, unative_t arg2 )463 unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4) 462 464 { 463 465 call_t *call; … … 474 476 IPC_SET_ARG1(call->data, arg1); 475 477 IPC_SET_ARG2(call->data, arg2); 476 IPC_SET_ARG3(call->data, 0); 478 IPC_SET_ARG3(call->data, arg3); 479 IPC_SET_ARG4(call->data, arg4); 477 480 478 481 if (!(res = request_preprocess(call))) … … 491 494 * @return See sys_ipc_call_async_fast(). 492 495 */ 493 unative_t sys_ipc_call_async (unative_t phoneid, ipc_data_t *data)496 unative_t sys_ipc_call_async_slow(unative_t phoneid, ipc_data_t *data) 494 497 { 495 498 call_t *call; -
kernel/generic/src/syscall/syscall.c
rbc50fc42 r3209923 136 136 (syshandler_t) sys_ipc_call_sync_slow, 137 137 (syshandler_t) sys_ipc_call_async_fast, 138 (syshandler_t) sys_ipc_call_async ,138 (syshandler_t) sys_ipc_call_async_slow, 139 139 (syshandler_t) sys_ipc_answer_fast, 140 140 (syshandler_t) sys_ipc_answer, -
uspace/app/tester/ipc/send_async.c
rbc50fc42 r3209923 49 49 phoneid = c - '0'; 50 50 51 ipc_call_async (phoneid, 2000,0, (void *) msgid, callback, 1);51 ipc_call_async_0(phoneid, 2000, (void *) msgid, callback, 1); 52 52 printf("Async sent - msg %d\n", msgid); 53 53 msgid++; -
uspace/lib/libc/generic/ipc.c
rbc50fc42 r3209923 190 190 static ipc_callid_t _ipc_call_async(int phoneid, ipc_call_t *data) 191 191 { 192 return __SYSCALL2(SYS_IPC_CALL_ASYNC , phoneid, (sysarg_t) data);192 return __SYSCALL2(SYS_IPC_CALL_ASYNC_SLOW, phoneid, (sysarg_t) data); 193 193 } 194 194 … … 269 269 /** Make a fast asynchronous call. 270 270 * 271 * This function can only handle twoarguments of payload. It is, however,272 * faster than the more generic ipc_call_async_ 3().271 * This function can only handle four arguments of payload. It is, however, 272 * faster than the more generic ipc_call_async_slow(). 273 273 * 274 274 * Note that this function is a void function. … … 281 281 * @param arg1 Service-defined payload argument. 282 282 * @param arg2 Service-defined payload argument. 283 * @param arg3 Service-defined payload argument. 284 * @param arg4 Service-defined payload argument. 283 285 * @param private Argument to be passed to the answer/error callback. 284 286 * @param callback Answer or error callback. … … 287 289 * asynchronous calls. 288 290 */ 289 void ipc_call_async_ 2(int phoneid, ipcarg_t method, ipcarg_t arg1,290 ipcarg_t arg2, void *private, ipc_async_callback_t callback,291 i nt can_preempt)291 void ipc_call_async_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, 292 ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, void *private, 293 ipc_async_callback_t callback, int can_preempt) 292 294 { 293 295 async_call_t *call = NULL; … … 305 307 */ 306 308 futex_down(&ipc_futex); 307 callid = __SYSCALL 4(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1,308 arg2 );309 callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1, 310 arg2, arg3, arg4); 309 311 310 312 if (callid == IPC_CALLRET_TEMPORARY) { … … 317 319 IPC_SET_ARG1(call->u.msg.data, arg1); 318 320 IPC_SET_ARG2(call->u.msg.data, arg2); 321 IPC_SET_ARG3(call->u.msg.data, arg3); 322 IPC_SET_ARG4(call->u.msg.data, arg4); 319 323 } 320 324 ipc_finish_async(callid, phoneid, call, can_preempt); … … 333 337 * @param arg2 Service-defined payload argument. 334 338 * @param arg3 Service-defined payload argument. 339 * @param arg4 Service-defined payload argument. 340 * @param arg5 Service-defined payload argument. 335 341 * @param private Argument to be passed to the answer/error callback. 336 342 * @param callback Answer or error callback. … … 340 346 * 341 347 */ 342 void ipc_call_async_ 3(int phoneid, ipcarg_t method, ipcarg_t arg1,343 ipcarg_t arg2, ipcarg_t arg3, void *private, ipc_async_callback_t callback,344 i nt can_preempt)348 void ipc_call_async_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, 349 ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, void *private, 350 ipc_async_callback_t callback, int can_preempt) 345 351 { 346 352 async_call_t *call; … … 355 361 IPC_SET_ARG2(call->u.msg.data, arg2); 356 362 IPC_SET_ARG3(call->u.msg.data, arg3); 363 IPC_SET_ARG4(call->u.msg.data, arg4); 364 IPC_SET_ARG5(call->u.msg.data, arg5); 357 365 /* 358 * We need to make sure that we get callid before another thread accesses359 * the queue again.366 * We need to make sure that we get callid before another thread 367 * accesses the queue again. 360 368 */ 361 369 futex_down(&ipc_futex); -
uspace/lib/libc/include/ipc/ipc.h
rbc50fc42 r3209923 38 38 #include <kernel/ipc/ipc.h> 39 39 #include <kernel/ddi/irq.h> 40 #include <libc.h>41 40 #include <sys/types.h> 42 41 #include <kernel/synch/synch.h> … … 184 183 ipcarg_t *result5); 185 184 186 187 185 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags); 188 186 extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *data, uint32_t usec); … … 194 192 195 193 #define ipc_answer_fast_0(callid, retval) \ 196 194 ipc_answer_fast((callid), (retval), 0, 0) 197 195 #define ipc_answer_fast_1(callid, retval, arg1) \ 198 196 ipc_answer_fast((callid), (retval), (arg1), 0) 199 197 extern ipcarg_t ipc_answer_fast(ipc_callid_t callid, ipcarg_t retval, 200 198 ipcarg_t arg1, ipcarg_t arg2); 201 199 extern ipcarg_t ipc_answer(ipc_callid_t callid, ipc_call_t *call); 202 200 203 #define ipc_call_async(phoneid, method, arg1, private, callback, can_preempt) \ 204 (ipc_call_async_2(phoneid, method, arg1, 0, private, callback, can_preempt)) 205 extern void ipc_call_async_2(int phoneid, ipcarg_t method, ipcarg_t arg1, 206 ipcarg_t arg2, void *private, ipc_async_callback_t callback, 207 int can_preempt); 208 extern void ipc_call_async_3(int phoneid, ipcarg_t method, ipcarg_t arg1, 209 ipcarg_t arg2, ipcarg_t arg3, void *private, ipc_async_callback_t callback, 210 int can_preempt); 201 /* 202 * User-friendly wrappers for ipc_call_async_fast() and ipc_call_async_slow(). 203 * They are in the form of ipc_call_async_m(), where m is the number of payload 204 * arguments. The macros decide between the fast and the slow version according 205 * to m. 206 */ 207 #define ipc_call_async_0(phoneid, method, private, callback, \ 208 can_preempt) \ 209 ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \ 210 (callback), (can_preempt)) 211 #define ipc_call_async_1(phoneid, method, arg1, private, callback, \ 212 can_preempt) \ 213 ipc_call_async_fast((phoneid), (method), (arg1), 0, 0, 0, (private), \ 214 (callback), (can_preempt)) 215 #define ipc_call_async_2(phoneid, method, arg1, arg2, private, callback, \ 216 can_preempt) \ 217 ipc_call_async_fast((phoneid), (method), (arg1), (arg2), 0, 0, \ 218 (private), (callback), (can_preempt)) 219 #define ipc_call_async_3(phoneid, method, arg1, arg2, arg3, private, callback, \ 220 can_preempt) \ 221 ipc_call_async_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \ 222 (private), (callback), (can_preempt)) 223 #define ipc_call_async_4(phoneid, method, arg1, arg2, arg3, arg4, private, \ 224 callback, can_preempt) \ 225 ipc_call_async_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 226 (arg4), (private), (callback), (can_preempt)) 227 #define ipc_call_async_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, \ 228 private, callback, can_preempt) \ 229 ipc_call_async_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 230 (arg4), (arg5), (private), (callback), (can_preempt)) 231 232 extern void ipc_call_async_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, 233 ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, void *private, 234 ipc_async_callback_t callback, int can_preempt); 235 extern void ipc_call_async_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, 236 ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, void *private, 237 ipc_async_callback_t callback, int can_preempt); 211 238 212 239 extern int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phone); -
uspace/srv/console/console.c
rbc50fc42 r3209923 33 33 */ 34 34 35 /* TODO: remove */ 36 #include <stdio.h> 37 35 #include <libc.h> 38 36 #include <fb.h> 39 37 #include <ipc/ipc.h>
Note:
See TracChangeset
for help on using the changeset viewer.