Changeset f9b2cb4c in mainline for uspace/lib/c/generic/ns.c
- Timestamp:
- 2015-08-23T12:50:23Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ef495f
- Parents:
- 0dd16778
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ns.c
r0dd16778 rf9b2cb4c 43 43 { 44 44 async_exch_t *exch = async_exchange_begin(session_ns); 45 int rc = async_connect_to_me(exch, 0, service, 0 , NULL, NULL);45 int rc = async_connect_to_me(exch, 0, service, 0); 46 46 async_exchange_end(exch); 47 47 … … 49 49 } 50 50 51 async_sess_t *service_connect_iface(exch_mgmt_t mgmt, sysarg_t iface,52 service_t service, sysarg_t arg3)53 {54 async_exch_t *exch = async_exchange_begin(session_ns);55 if (!exch)56 return NULL;57 58 async_sess_t *sess =59 async_connect_me_to(mgmt, exch, iface, service, arg3);60 async_exchange_end(exch);61 62 if (!sess)63 return NULL;64 65 /*66 * FIXME Ugly hack to work around limitation of implementing67 * parallel exchanges using multiple connections. Shift out68 * first argument for non-initial connections.69 */70 async_sess_args_set(sess, iface, arg3, 0);71 72 return sess;73 }74 51 75 async_sess_t *service_connect_iface_extended(service_t service, iface_t iface, 76 sysarg_t arg3) 52 async_sess_t *service_connect(service_t service, iface_t iface, sysarg_t arg3) 77 53 { 78 54 async_exch_t *exch = async_exchange_begin(session_ns); … … 97 73 } 98 74 99 async_sess_t *service_connect(exch_mgmt_t mgmt, service_t service, sysarg_t arg3) 100 { 101 async_exch_t *exch = async_exchange_begin(session_ns); 102 if (!exch) 103 return NULL; 104 105 async_sess_t *sess = 106 async_connect_me_to(mgmt, exch, 0, service, arg3); 107 async_exchange_end(exch); 108 109 if (!sess) 110 return NULL; 111 112 /* 113 * FIXME Ugly hack to work around limitation of implementing 114 * parallel exchanges using multiple connections. Shift out 115 * first argument for non-initial connections. 116 */ 117 async_sess_args_set(sess, 0, arg3, 0); 118 119 return sess; 120 } 121 122 async_sess_t *service_connect_blocking_iface(exch_mgmt_t mgmt, sysarg_t iface, 123 service_t service, sysarg_t arg3) 124 { 125 async_exch_t *exch = async_exchange_begin(session_ns); 126 if (!exch) 127 return NULL; 128 async_sess_t *sess = 129 async_connect_me_to_blocking(mgmt, exch, iface, service, arg3); 130 async_exchange_end(exch); 131 132 if (!sess) 133 return NULL; 134 135 /* 136 * FIXME Ugly hack to work around limitation of implementing 137 * parallel exchanges using multiple connections. Shift out 138 * first argument for non-initial connections. 139 */ 140 async_sess_args_set(sess, iface, arg3, 0); 141 142 return sess; 143 } 144 145 async_sess_t *service_connect_blocking_iface_extended(service_t service, 146 iface_t iface, sysarg_t arg3) 75 async_sess_t *service_connect_blocking(service_t service, iface_t iface, 76 sysarg_t arg3) 147 77 { 148 78 async_exch_t *exch = async_exchange_begin(session_ns); … … 164 94 } 165 95 166 async_sess_t *service_connect_blocking(exch_mgmt_t mgmt, service_t service,167 sysarg_t arg3)168 {169 async_exch_t *exch = async_exchange_begin(session_ns);170 async_sess_t *sess =171 async_connect_me_to_blocking(mgmt, exch, 0, service, arg3);172 async_exchange_end(exch);173 174 if (!sess)175 return NULL;176 177 /*178 * FIXME Ugly hack to work around limitation of implementing179 * parallel exchanges using multiple connections. Shift out180 * first argument for non-initial connections.181 */182 async_sess_args_set(sess, 0, arg3, 0);183 184 return sess;185 }186 187 /** Create bidirectional connection with a service188 *189 * @param[in] service Service.190 * @param[in] arg1 First parameter.191 * @param[in] arg2 Second parameter.192 * @param[in] arg3 Third parameter.193 * @param[in] client_receiver Message receiver.194 *195 * @return Session to the service.196 * @return Other error codes as defined by async_connect_to_me().197 *198 */199 async_sess_t *service_bind(service_t service, sysarg_t arg1, sysarg_t arg2,200 sysarg_t arg3, async_port_handler_t client_receiver)201 {202 /* Connect to the needed service */203 async_sess_t *sess =204 service_connect_blocking(EXCHANGE_SERIALIZE, service, 0);205 if (sess != NULL) {206 /* Request callback connection */207 async_exch_t *exch = async_exchange_begin(sess);208 int rc = async_connect_to_me(exch, arg1, arg2, arg3,209 client_receiver, NULL);210 async_exchange_end(exch);211 212 if (rc != EOK) {213 async_hangup(sess);214 errno = rc;215 return NULL;216 }217 }218 219 return sess;220 }221 96 222 97 int ns_ping(void)
Note:
See TracChangeset
for help on using the changeset viewer.