Changeset 007e6efa in mainline for uspace/lib/c
- Timestamp:
- 2011-01-28T15:44:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4db1fbf
- Parents:
- ae0300b5
- Location:
- uspace/lib/c
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/Makefile
rae0300b5 r007e6efa 83 83 generic/io/console.c \ 84 84 generic/io/screenbuffer.c \ 85 generic/ipc/ns.c \ 85 86 generic/malloc.c \ 86 87 generic/sysinfo.c \ -
uspace/lib/c/generic/async.c
rae0300b5 r007e6efa 58 58 * int fibril1(void *arg) 59 59 * { 60 * conn = ipc_connect_me_to();60 * conn = async_connect_me_to(); 61 61 * c1 = async_send(conn); 62 62 * c2 = async_send(conn); … … 1235 1235 } 1236 1236 1237 /** Wrapper for making IPC_M_CONNECT_TO_ME calls using the async framework. 1238 * 1239 * Ask through phone for a new connection to some service. 1240 * 1241 * @param phone Phone handle used for contacting the other side. 1242 * @param arg1 User defined argument. 1243 * @param arg2 User defined argument. 1244 * @param arg3 User defined argument. 1245 * @param client_receiver Connection handing routine. 1246 * 1247 * @return New phone handle on success or a negative error code. 1248 * 1249 */ 1250 int async_connect_to_me(int phone, sysarg_t arg1, sysarg_t arg2, 1251 sysarg_t arg3, async_client_conn_t client_receiver) 1252 { 1253 sysarg_t task_hash; 1254 sysarg_t phone_hash; 1255 int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3, 1256 NULL, NULL, NULL, &task_hash, &phone_hash); 1257 if (rc != EOK) 1258 return rc; 1259 1260 if (client_receiver != NULL) 1261 async_new_connection(task_hash, phone_hash, 0, NULL, 1262 client_receiver); 1263 1264 return EOK; 1265 } 1266 1237 1267 /** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework. 1238 * 1268 * 1239 1269 * Ask through phone for a new connection to some service. 1240 1270 * 1241 * @param phone idPhone handle used for contacting the other side.1242 * @param arg1 1243 * @param arg2 1244 * @param arg3 1245 * 1246 * @return 1247 * /1248 int 1249 async_connect_me_to(int phoneid, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3) 1250 { 1251 int rc; 1271 * @param phone Phone handle used for contacting the other side. 1272 * @param arg1 User defined argument. 1273 * @param arg2 User defined argument. 1274 * @param arg3 User defined argument. 1275 * 1276 * @return New phone handle on success or a negative error code. 1277 * 1278 */ 1279 int async_connect_me_to(int phone, sysarg_t arg1, sysarg_t arg2, 1280 sysarg_t arg3) 1281 { 1252 1282 sysarg_t newphid; 1253 1254 rc = async_req_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, NULL, 1255 NULL, NULL, NULL, &newphid); 1256 1257 if (rc != EOK) 1283 int rc = async_req_3_5(phone, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, 1284 NULL, NULL, NULL, NULL, &newphid); 1285 1286 if (rc != EOK) 1258 1287 return rc; 1259 1288 1260 1289 return newphid; 1261 1290 } 1262 1291 1263 1292 /** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework. 1264 * 1293 * 1265 1294 * Ask through phone for a new connection to some service and block until 1266 1295 * success. 1267 1296 * 1268 * @param phoneid 1269 * @param arg1 1270 * @param arg2 1271 * @param arg3 1272 * 1273 * @return 1274 * /1275 int 1276 async_connect_me_to_blocking(int phoneid, sysarg_t arg1, sysarg_t arg2,1297 * @param phoneid Phone handle used for contacting the other side. 1298 * @param arg1 User defined argument. 1299 * @param arg2 User defined argument. 1300 * @param arg3 User defined argument. 1301 * 1302 * @return New phone handle on success or a negative error code. 1303 * 1304 */ 1305 int async_connect_me_to_blocking(int phoneid, sysarg_t arg1, sysarg_t arg2, 1277 1306 sysarg_t arg3) 1278 1307 { 1279 int rc;1280 1308 sysarg_t newphid; 1281 1282 rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, 1309 int rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, 1283 1310 IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid); 1284 1311 1285 if (rc != EOK) 1312 if (rc != EOK) 1286 1313 return rc; 1287 1314 1288 1315 return newphid; 1289 1316 } -
uspace/lib/c/generic/clipboard.c
rae0300b5 r007e6efa 39 39 40 40 #include <clipboard.h> 41 #include <ipc/ns.h> 41 42 #include <ipc/services.h> 42 43 #include <ipc/clipboard.h> … … 54 55 { 55 56 while (clip_phone < 0) 56 clip_phone = ipc_connect_me_to_blocking(PHONE_NS,SERVICE_CLIPBOARD, 0, 0);57 clip_phone = service_connect_blocking(SERVICE_CLIPBOARD, 0, 0); 57 58 } 58 59 -
uspace/lib/c/generic/devmap.c
rae0300b5 r007e6efa 31 31 #include <ipc/ipc.h> 32 32 #include <ipc/services.h> 33 #include <ipc/ns.h> 33 34 #include <ipc/devmap.h> 34 35 #include <devmap.h> … … 50 51 51 52 if (flags & IPC_FLAG_BLOCKING) 52 devmap_phone_driver = ipc_connect_me_to_blocking(PHONE_NS,53 SERVICE_DEVMAP,DEVMAP_DRIVER, 0);53 devmap_phone_driver = service_connect_blocking(SERVICE_DEVMAP, 54 DEVMAP_DRIVER, 0); 54 55 else 55 devmap_phone_driver = ipc_connect_me_to(PHONE_NS,56 SERVICE_DEVMAP,DEVMAP_DRIVER, 0);56 devmap_phone_driver = service_connect(SERVICE_DEVMAP, 57 DEVMAP_DRIVER, 0); 57 58 58 59 return devmap_phone_driver; … … 62 63 63 64 if (flags & IPC_FLAG_BLOCKING) 64 devmap_phone_client = ipc_connect_me_to_blocking(PHONE_NS,65 SERVICE_DEVMAP,DEVMAP_CLIENT, 0);65 devmap_phone_client = service_connect_blocking(SERVICE_DEVMAP, 66 DEVMAP_CLIENT, 0); 66 67 else 67 devmap_phone_client = ipc_connect_me_to(PHONE_NS,68 SERVICE_DEVMAP,DEVMAP_CLIENT, 0);68 devmap_phone_client = service_connect(SERVICE_DEVMAP, 69 DEVMAP_CLIENT, 0); 69 70 70 71 return devmap_phone_client; -
uspace/lib/c/generic/loader.c
rae0300b5 r007e6efa 36 36 #include <ipc/loader.h> 37 37 #include <ipc/services.h> 38 #include <ipc/ns.h> 38 39 #include <libc.h> 39 40 #include <task.h> … … 63 64 loader_t *loader_connect(void) 64 65 { 65 int phone_id = ipc_connect_me_to_blocking(PHONE_NS,SERVICE_LOAD, 0, 0);66 int phone_id = service_connect_blocking(SERVICE_LOAD, 0, 0); 66 67 if (phone_id < 0) 67 68 return NULL; -
uspace/lib/c/generic/vfs/vfs.c
rae0300b5 r007e6efa 45 45 #include <ipc/ipc.h> 46 46 #include <ipc/services.h> 47 #include <ipc/ns.h> 47 48 #include <async.h> 48 49 #include <fibril_synch.h> … … 118 119 static void vfs_connect(void) 119 120 { 120 while (vfs_phone < 0) { 121 vfs_phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 122 0, 0); 123 } 121 while (vfs_phone < 0) 122 vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0); 124 123 125 124 async_session_create(&vfs_session, vfs_phone, 0); -
uspace/lib/c/include/async.h
rae0300b5 r007e6efa 266 266 } 267 267 268 extern int async_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, 269 async_client_conn_t); 268 270 extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 269 271 extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t); -
uspace/lib/c/include/ipc/ns.h
rae0300b5 r007e6efa 36 36 #define LIBIPC_NS_H_ 37 37 38 #include <sys/types.h> 38 39 #include <ipc/ipc.h> 39 40 … … 45 46 } ns_request_t; 46 47 48 extern int service_register(sysarg_t); 49 extern int service_connect(sysarg_t, sysarg_t, sysarg_t); 50 extern int service_connect_blocking(sysarg_t, sysarg_t, sysarg_t); 51 52 extern wchar_t *service_klog_share_in(size_t *); 53 47 54 #endif 48 55
Note:
See TracChangeset
for help on using the changeset viewer.