Changeset 2e51969 in mainline
- Timestamp:
- 2007-11-19T12:20:10Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c09f2b
- Parents:
- e0bc7fc
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/sysipc.h
re0bc7fc r2e51969 41 41 42 42 unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, 43 unative_t arg1, ipc_data_t *data);44 unative_t sys_ipc_call_sync (unative_t phoneid, ipc_data_t *question,43 unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data); 44 unative_t sys_ipc_call_sync_slow(unative_t phoneid, ipc_data_t *question, 45 45 ipc_data_t *reply); 46 46 unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, -
kernel/generic/include/syscall/syscall.h
re0bc7fc r2e51969 49 49 SYS_AS_AREA_DESTROY, 50 50 SYS_IPC_CALL_SYNC_FAST, 51 SYS_IPC_CALL_SYNC ,51 SYS_IPC_CALL_SYNC_SLOW, 52 52 SYS_IPC_CALL_ASYNC_FAST, 53 53 SYS_IPC_CALL_ASYNC, -
kernel/generic/src/ipc/sysipc.c
re0bc7fc r2e51969 349 349 /** Make a fast call over IPC, wait for reply and return to user. 350 350 * 351 * This function can handle only one argumentof payload, but is faster than352 * the generic function (i.e. sys_ipc_call_sync ()).351 * This function can handle only three arguments of payload, but is faster than 352 * the generic function (i.e. sys_ipc_call_sync_slow()). 353 353 * 354 354 * @param phoneid Phone handle for the call. 355 355 * @param method Method of the call. 356 356 * @param arg1 Service-defined payload argument. 357 * @param arg2 Service-defined payload argument. 358 * @param arg3 Service-defined payload argument. 357 359 * @param data Address of userspace structure where the reply call will 358 360 * be stored. … … 362 364 */ 363 365 unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, 364 unative_t arg1, ipc_data_t *data)366 unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data) 365 367 { 366 368 call_t call; … … 373 375 IPC_SET_METHOD(call.data, method); 374 376 IPC_SET_ARG1(call.data, arg1); 377 IPC_SET_ARG2(call.data, arg2); 378 IPC_SET_ARG3(call.data, arg3); 375 379 376 380 if (!(res = request_preprocess(&call))) { … … 394 398 * @return Zero on success or an error code. 395 399 */ 396 unative_t sys_ipc_call_sync (unative_t phoneid, ipc_data_t *question,400 unative_t sys_ipc_call_sync_slow(unative_t phoneid, ipc_data_t *question, 397 401 ipc_data_t *reply) 398 402 { -
kernel/generic/src/syscall/syscall.c
re0bc7fc r2e51969 134 134 /* IPC related syscalls. */ 135 135 (syshandler_t) sys_ipc_call_sync_fast, 136 (syshandler_t) sys_ipc_call_sync ,136 (syshandler_t) sys_ipc_call_sync_slow, 137 137 (syshandler_t) sys_ipc_call_async_fast, 138 138 (syshandler_t) sys_ipc_call_async, -
uspace/app/klog/klog.c
re0bc7fc r2e51969 64 64 65 65 mapping = as_get_mappable_page(PAGE_SIZE); 66 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, 67 (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_KLOG, 68 NULL, NULL, NULL); 66 res = ipc_call_sync_3_0(PHONE_NS, IPC_M_AS_AREA_RECV, 67 (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_KLOG); 69 68 if (res) { 70 69 printf("Failed to initialize klog memarea\n"); -
uspace/app/tester/ipc/send_sync.c
re0bc7fc r2e51969 30 30 #include <unistd.h> 31 31 #include "../tester.h" 32 #include <ipc/ipc.h> 32 33 33 34 char * test_send_sync(bool quiet) … … 45 46 46 47 printf("Sending msg..."); 47 res = ipc_call_sync_ 2(phoneid, 2000, 0, 0, NULL, NULL);48 res = ipc_call_sync_0_0(phoneid, 2000); 48 49 printf("done: %d\n", res); 49 50 -
uspace/lib/libc/generic/ipc.c
re0bc7fc r2e51969 85 85 /** Make a fast synchronous call. 86 86 * 87 * Only one payload argument can be passed using this function. However, this 88 * function is faster than the generic ipc_call_sync_3(). 89 * 90 * @param phoneid Phone handle for the call. 91 * @param method Requested method. 92 * @param arg1 Service-defined payload argument. 93 * @param result If non-NULL, the return ARG1 will be stored there. 94 * 95 * @return Negative values represent errors returned by IPC. 96 * Otherwise the RETVAL of the answer is returned. 97 */ 98 int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t *result) 99 { 100 ipc_call_t resdata; 101 int callres; 102 103 callres = __SYSCALL4(SYS_IPC_CALL_SYNC_FAST, phoneid, method, arg1, 104 (sysarg_t) &resdata); 105 if (callres) 106 return callres; 107 if (result) 108 *result = IPC_GET_ARG1(resdata); 109 return IPC_GET_RETVAL(resdata); 110 } 111 112 /** Make a synchronous call transmitting 3 arguments of payload. 87 * Only three payload arguments can be passed using this function. However, this 88 * function is faster than the generic ipc_call_sync_slow() because the payload 89 * is passed directly in registers. 113 90 * 114 91 * @param phoneid Phone handle for the call. … … 117 94 * @param arg2 Service-defined payload argument. 118 95 * @param arg3 Service-defined payload argument. 96 * @param result1 If non-NULL, the return ARG1 will be stored there. 97 * @param result2 If non-NULL, the return ARG2 will be stored there. 98 * @param result3 If non-NULL, the return ARG3 will be stored there. 99 * @param result4 If non-NULL, the return ARG4 will be stored there. 100 * @param result5 If non-NULL, the return ARG5 will be stored there. 101 * 102 * @return Negative values represent errors returned by IPC. 103 * Otherwise the RETVAL of the answer is returned. 104 */ 105 int 106 ipc_call_sync_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, 107 ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3, 108 ipcarg_t *result4, ipcarg_t *result5) 109 { 110 ipc_call_t resdata; 111 int callres; 112 113 callres = __SYSCALL6(SYS_IPC_CALL_SYNC_FAST, phoneid, method, arg1, 114 arg2, arg3, (sysarg_t) &resdata); 115 if (callres) 116 return callres; 117 if (result1) 118 *result1 = IPC_GET_ARG1(resdata); 119 if (result2) 120 *result2 = IPC_GET_ARG2(resdata); 121 if (result3) 122 *result3 = IPC_GET_ARG3(resdata); 123 if (result4) 124 *result4 = IPC_GET_ARG4(resdata); 125 if (result5) 126 *result5 = IPC_GET_ARG5(resdata); 127 128 return IPC_GET_RETVAL(resdata); 129 } 130 131 /** Make a synchronous call transmitting 5 arguments of payload. 132 * 133 * @param phoneid Phone handle for the call. 134 * @param method Requested method. 135 * @param arg1 Service-defined payload argument. 136 * @param arg2 Service-defined payload argument. 137 * @param arg3 Service-defined payload argument. 138 * @param arg4 Service-defined payload argument. 139 * @param arg5 Service-defined payload argument. 119 140 * @param result1 If non-NULL, storage for the first return argument. 120 141 * @param result2 If non-NULL, storage for the second return argument. 121 142 * @param result3 If non-NULL, storage for the third return argument. 143 * @param result4 If non-NULL, storage for the fourth return argument. 144 * @param result5 If non-NULL, storage for the fifth return argument. 122 145 * 123 146 * @return Negative value means IPC error. 124 147 * Otherwise the RETVAL of the answer. 125 148 */ 126 int ipc_call_sync_3(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, 127 ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3) 149 int 150 ipc_call_sync_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, 151 ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *result1, 152 ipcarg_t *result2, ipcarg_t *result3, ipcarg_t *result4, ipcarg_t *result5) 128 153 { 129 154 ipc_call_t data; … … 134 159 IPC_SET_ARG2(data, arg2); 135 160 IPC_SET_ARG3(data, arg3); 136 137 callres = __SYSCALL3(SYS_IPC_CALL_SYNC, phoneid, (sysarg_t) &data, 161 IPC_SET_ARG4(data, arg4); 162 IPC_SET_ARG5(data, arg5); 163 164 callres = __SYSCALL3(SYS_IPC_CALL_SYNC_SLOW, phoneid, (sysarg_t) &data, 138 165 (sysarg_t) &data); 139 166 if (callres) … … 146 173 if (result3) 147 174 *result3 = IPC_GET_ARG3(data); 175 if (result4) 176 *result4 = IPC_GET_ARG4(data); 177 if (result5) 178 *result5 = IPC_GET_ARG5(data); 179 148 180 return IPC_GET_RETVAL(data); 149 181 } … … 516 548 int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phonehash) 517 549 { 518 return ipc_call_sync_ 3(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2, 0, 0,519 0, phonehash);550 return ipc_call_sync_2_3(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2, 551 NULL, NULL, phonehash); 520 552 } 521 553 … … 533 565 int res; 534 566 535 res = ipc_call_sync_ 3(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, 0, 0, 0,536 &newphid);567 res = ipc_call_sync_2_3(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, NULL, 568 NULL, &newphid); 537 569 if (res) 538 570 return res; … … 606 638 int ipc_data_send(int phoneid, void *src, size_t size) 607 639 { 608 return ipc_call_sync_3 (phoneid, IPC_M_DATA_SEND, 0, (ipcarg_t) src,609 (ipcarg_t) size , NULL, NULL, NULL);640 return ipc_call_sync_3_0(phoneid, IPC_M_DATA_SEND, 0, (ipcarg_t) src, 641 (ipcarg_t) size); 610 642 } 611 643 -
uspace/lib/libc/generic/time.c
re0bc7fc r2e51969 142 142 mapping = as_get_mappable_page(PAGE_SIZE); 143 143 /* Get the mapping of kernel clock */ 144 res = ipc_call_sync_3 (PHONE_NS, IPC_M_AS_AREA_RECV,144 res = ipc_call_sync_3_2(PHONE_NS, IPC_M_AS_AREA_RECV, 145 145 (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, NULL, 146 &rights , NULL);146 &rights); 147 147 if (res) { 148 148 printf("Failed to initialize timeofday memarea\n"); -
uspace/lib/libc/include/ipc/ipc.h
re0bc7fc r2e51969 52 52 ipc_call_t *data); 53 53 54 #define ipc_call_sync_2(phoneid, method, arg1, arg2, res1, res2) \ 55 ipc_call_sync_3((phoneid), (method), (arg1), (arg2), 0, (res1), \ 56 (res2), 0) 57 extern int ipc_call_sync_3(int phoneid, ipcarg_t method, ipcarg_t arg1, 54 /* 55 * User-friendly wrappers for ipc_call_sync_fast() and ipc_call_sync_slow(). 56 * They are in the form ipc_call_sync_m_n(), where m denotes the number of 57 * arguments of payload and n denotes number of return values. Whenever 58 * possible, the fast version is used. 59 */ 60 #define ipc_call_sync_0_0(phoneid, method) \ 61 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0) 62 #define ipc_call_sync_0_1(phoneid, method, res1) \ 63 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), 0, 0, 0, 0) 64 #define ipc_call_sync_0_2(phoneid, method, res1, res2) \ 65 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), 0, 0, 0) 66 #define ipc_call_sync_0_3(phoneid, method, res1, res2, res3) \ 67 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \ 68 0, 0) 69 #define ipc_call_sync_0_4(phoneid, method, res1, res2, res3, res4) \ 70 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \ 71 (res4), 0) 72 #define ipc_call_sync_0_5(phoneid, method, res1, res2, res3, res4, res5) \ 73 ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \ 74 (res4), (res5)) 75 #define ipc_call_sync_1_0(phoneid, method, arg1) \ 76 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, 0, 0, 0, 0, 0) 77 #define ipc_call_sync_1_1(phoneid, method, arg1, res1) \ 78 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), 0, 0, 0, 0) 79 #define ipc_call_sync_1_2(phoneid, method, arg1, res1, res2) \ 80 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), 0, \ 81 0, 0) 82 #define ipc_call_sync_1_3(phoneid, method, arg1, res1, res2, res3) \ 83 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \ 84 (res3), 0, 0) 85 #define ipc_call_sync_1_4(phoneid, method, arg1, res1, res2, res3, res4) \ 86 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \ 87 (res3), (res4), 0) 88 #define ipc_call_sync_1_5(phoneid, method, arg1, res1, res2, res3, res4, \ 89 res5) \ 90 ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \ 91 (res3), (res4), (res5)) 92 #define ipc_call_sync_2_0(phoneid, method, arg1, arg2) \ 93 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, 0, 0, 0, \ 94 0, 0) 95 #define ipc_call_sync_2_1(phoneid, method, arg1, arg2, res1) \ 96 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), 0, 0, \ 97 0, 0) 98 #define ipc_call_sync_2_2(phoneid, method, arg1, arg2, res1, res2) \ 99 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ 100 (res2), 0, 0, 0) 101 #define ipc_call_sync_2_3(phoneid, method, arg1, arg2, res1, res2, res3) \ 102 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ 103 (res2), (res3), 0, 0) 104 #define ipc_call_sync_2_4(phoneid, method, arg1, arg2, res1, res2, res3, \ 105 res4) \ 106 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ 107 (res2), (res3), (res4), 0) 108 #define ipc_call_sync_2_5(phoneid, method, arg1, arg2, res1, res2, res3, \ 109 res4, res5)\ 110 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ 111 (res2), (res3), (res4), (res5)) 112 #define ipc_call_sync_3_0(phoneid, method, arg1, arg2, arg3) \ 113 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, 0, 0, \ 114 0, 0) 115 #define ipc_call_sync_3_1(phoneid, method, arg1, arg2, arg3, res1) \ 116 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \ 117 0, 0, 0, 0) 118 #define ipc_call_sync_3_2(phoneid, method, arg1, arg2, arg3, res1, res2) \ 119 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \ 120 (res2), 0, 0, 0) 121 #define ipc_call_sync_3_3(phoneid, method, arg1, arg2, arg3, res1, res2, \ 122 res3) \ 123 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 124 (res1), (res2), (res3), 0, 0) 125 #define ipc_call_sync_3_4(phoneid, method, arg1, arg2, arg3, res1, res2, \ 126 res3, res4) \ 127 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 128 (res1), (res2), (res3), (res4), 0) 129 #define ipc_call_sync_3_5(phoneid, method, arg1, arg2, arg3, res1, res2, \ 130 res3, res4, res5) \ 131 ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \ 132 (res1), (res2), (res3), (res4), (res5)) 133 #define ipc_call_sync_4_0(phoneid, method, arg1, arg2, arg3, arg4) \ 134 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ 135 0, 0, 0, 0, 0) 136 #define ipc_call_sync_4_1(phoneid, method, arg1, arg2, arg3, arg4, res1) \ 137 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ 138 (res1), 0, 0, 0, 0) 139 #define ipc_call_sync_4_2(phoneid, method, arg1, arg2, arg3, arg4, res1, res2) \ 140 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ 141 (res1), (res2), 0, 0, 0) 142 #define ipc_call_sync_4_3(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \ 143 res3) \ 144 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 145 (arg4), (res1), (res2), (res3), 0, 0) 146 #define ipc_call_sync_4_4(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \ 147 res3, res4) \ 148 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 149 (arg4), (res1), (res2), (res3), (res4), 0) 150 #define ipc_call_sync_4_5(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \ 151 res3, res4, res5) \ 152 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 153 (arg4), (res1), (res2), (res3), (res4), (res5)) 154 #define ipc_call_sync_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \ 155 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ 156 (arg5), 0, 0, 0, 0, 0) 157 #define ipc_call_sync_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1) \ 158 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ 159 (arg5), (res1), 0, 0, 0, 0) 160 #define ipc_call_sync_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ 161 res2) \ 162 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 163 (arg4), (arg5), (res1), (res2), 0, 0, 0) 164 #define ipc_call_sync_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ 165 res2, res3) \ 166 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 167 (arg4), (arg5), (res1), (res2), (res3), 0, 0) 168 #define ipc_call_sync_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ 169 res2, res3, res4) \ 170 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 171 (arg4), (arg5), (res1), (res2), (res3), (res4), 0) 172 #define ipc_call_sync_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ 173 res2, res3, res4, res5) \ 174 ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ 175 (arg4), (arg5), (res1), (res2), (res3), (res4), (res5)) 176 177 extern int ipc_call_sync_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, 58 178 ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2, 59 ipcarg_t *result3); 60 61 extern int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1, 62 ipcarg_t *result); 179 ipcarg_t *result3, ipcarg_t *result4, ipcarg_t *result5); 180 181 extern int ipc_call_sync_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, 182 ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, 183 ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3, ipcarg_t *result4, 184 ipcarg_t *result5); 185 63 186 64 187 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags); -
uspace/srv/fs/fat/fat.c
re0bc7fc r2e51969 158 158 * Request sharing the Path Lookup Buffer with VFS. 159 159 */ 160 rc = ipc_call_sync_ 3(vfs_phone, IPC_M_AS_AREA_RECV, (ipcarg_t) plb_ro,161 PLB_SIZE , 0, NULL, NULL, NULL);160 rc = ipc_call_sync_2_0(vfs_phone, IPC_M_AS_AREA_RECV, (ipcarg_t) plb_ro, 161 PLB_SIZE); 162 162 if (rc) { 163 163 async_wait_for(req, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.