Changeset a46e56b in mainline for uspace/lib/c/generic
- Timestamp:
- 2018-03-22T06:49:35Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- Location:
- uspace/lib/c/generic
- Files:
-
- 13 edited
-
bd.c (modified) (4 diffs)
-
bd_srv.c (modified) (16 diffs)
-
inet.c (modified) (6 diffs)
-
inet/tcp.c (modified) (21 diffs)
-
inet/udp.c (modified) (4 diffs)
-
inetping.c (modified) (5 diffs)
-
io/chardev_srv.c (modified) (10 diffs)
-
io/con_srv.c (modified) (22 diffs)
-
io/input.c (modified) (8 diffs)
-
iplink.c (modified) (8 diffs)
-
iplink_srv.c (modified) (13 diffs)
-
loc.c (modified) (3 diffs)
-
vfs/vfs.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/bd.c
r3e242d2 ra46e56b 46 46 #include <offset.h> 47 47 48 static void bd_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg);48 static void bd_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg); 49 49 50 50 errno_t bd_open(async_sess_t *sess, bd_t **rbd) … … 196 196 } 197 197 198 static void bd_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)198 static void bd_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 199 199 { 200 200 bd_t *bd = (bd_t *)arg; … … 204 204 while (true) { 205 205 ipc_call_t call; 206 cap_call_handle_t c allid= async_get_call(&call);206 cap_call_handle_t chandle = async_get_call(&call); 207 207 208 208 if (!IPC_GET_IMETHOD(call)) { … … 213 213 switch (IPC_GET_IMETHOD(call)) { 214 214 default: 215 async_answer_0(c allid, ENOTSUP);215 async_answer_0(chandle, ENOTSUP); 216 216 } 217 217 } -
uspace/lib/c/generic/bd_srv.c
r3e242d2 ra46e56b 43 43 #include <bd_srv.h> 44 44 45 static void bd_read_blocks_srv(bd_srv_t *srv, cap_call_handle_t c allid,45 static void bd_read_blocks_srv(bd_srv_t *srv, cap_call_handle_t chandle, 46 46 ipc_call_t *call) 47 47 { … … 51 51 size_t size; 52 52 errno_t rc; 53 cap_call_handle_t rcall id;53 cap_call_handle_t rcall_handle; 54 54 55 55 ba = MERGE_LOUP32(IPC_GET_ARG1(*call), IPC_GET_ARG2(*call)); 56 56 cnt = IPC_GET_ARG3(*call); 57 57 58 if (!async_data_read_receive(&rcall id, &size)) {59 async_answer_0(c allid, EINVAL);58 if (!async_data_read_receive(&rcall_handle, &size)) { 59 async_answer_0(chandle, EINVAL); 60 60 return; 61 61 } … … 63 63 buf = malloc(size); 64 64 if (buf == NULL) { 65 async_answer_0(rcall id, ENOMEM);66 async_answer_0(c allid, ENOMEM);65 async_answer_0(rcall_handle, ENOMEM); 66 async_answer_0(chandle, ENOMEM); 67 67 return; 68 68 } 69 69 70 70 if (srv->srvs->ops->read_blocks == NULL) { 71 async_answer_0(rcall id, ENOTSUP);72 async_answer_0(c allid, ENOTSUP);71 async_answer_0(rcall_handle, ENOTSUP); 72 async_answer_0(chandle, ENOTSUP); 73 73 free(buf); 74 74 return; … … 77 77 rc = srv->srvs->ops->read_blocks(srv, ba, cnt, buf, size); 78 78 if (rc != EOK) { 79 async_answer_0(rcall id, ENOMEM);80 async_answer_0(c allid, ENOMEM);81 free(buf); 82 return; 83 } 84 85 async_data_read_finalize(rcall id, buf, size);79 async_answer_0(rcall_handle, ENOMEM); 80 async_answer_0(chandle, ENOMEM); 81 free(buf); 82 return; 83 } 84 85 async_data_read_finalize(rcall_handle, buf, size); 86 86 87 87 free(buf); 88 async_answer_0(c allid, EOK);89 } 90 91 static void bd_read_toc_srv(bd_srv_t *srv, cap_call_handle_t c allid,88 async_answer_0(chandle, EOK); 89 } 90 91 static void bd_read_toc_srv(bd_srv_t *srv, cap_call_handle_t chandle, 92 92 ipc_call_t *call) 93 93 { … … 96 96 size_t size; 97 97 errno_t rc; 98 cap_call_handle_t rcall id;98 cap_call_handle_t rcall_handle; 99 99 100 100 session = IPC_GET_ARG1(*call); 101 101 102 if (!async_data_read_receive(&rcall id, &size)) {103 async_answer_0(c allid, EINVAL);102 if (!async_data_read_receive(&rcall_handle, &size)) { 103 async_answer_0(chandle, EINVAL); 104 104 return; 105 105 } … … 107 107 buf = malloc(size); 108 108 if (buf == NULL) { 109 async_answer_0(rcall id, ENOMEM);110 async_answer_0(c allid, ENOMEM);109 async_answer_0(rcall_handle, ENOMEM); 110 async_answer_0(chandle, ENOMEM); 111 111 return; 112 112 } 113 113 114 114 if (srv->srvs->ops->read_toc == NULL) { 115 async_answer_0(rcall id, ENOTSUP);116 async_answer_0(c allid, ENOTSUP);115 async_answer_0(rcall_handle, ENOTSUP); 116 async_answer_0(chandle, ENOTSUP); 117 117 free(buf); 118 118 return; … … 121 121 rc = srv->srvs->ops->read_toc(srv, session, buf, size); 122 122 if (rc != EOK) { 123 async_answer_0(rcall id, ENOMEM);124 async_answer_0(c allid, ENOMEM);125 free(buf); 126 return; 127 } 128 129 async_data_read_finalize(rcall id, buf, size);123 async_answer_0(rcall_handle, ENOMEM); 124 async_answer_0(chandle, ENOMEM); 125 free(buf); 126 return; 127 } 128 129 async_data_read_finalize(rcall_handle, buf, size); 130 130 131 131 free(buf); 132 async_answer_0(c allid, EOK);133 } 134 135 static void bd_sync_cache_srv(bd_srv_t *srv, cap_call_handle_t c allid,132 async_answer_0(chandle, EOK); 133 } 134 135 static void bd_sync_cache_srv(bd_srv_t *srv, cap_call_handle_t chandle, 136 136 ipc_call_t *call) 137 137 { … … 144 144 145 145 if (srv->srvs->ops->sync_cache == NULL) { 146 async_answer_0(c allid, ENOTSUP);146 async_answer_0(chandle, ENOTSUP); 147 147 return; 148 148 } 149 149 150 150 rc = srv->srvs->ops->sync_cache(srv, ba, cnt); 151 async_answer_0(c allid, rc);152 } 153 154 static void bd_write_blocks_srv(bd_srv_t *srv, cap_call_handle_t c allid,151 async_answer_0(chandle, rc); 152 } 153 154 static void bd_write_blocks_srv(bd_srv_t *srv, cap_call_handle_t chandle, 155 155 ipc_call_t *call) 156 156 { … … 166 166 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); 167 167 if (rc != EOK) { 168 async_answer_0(c allid, rc);168 async_answer_0(chandle, rc); 169 169 return; 170 170 } 171 171 172 172 if (srv->srvs->ops->write_blocks == NULL) { 173 async_answer_0(c allid, ENOTSUP);173 async_answer_0(chandle, ENOTSUP); 174 174 return; 175 175 } … … 177 177 rc = srv->srvs->ops->write_blocks(srv, ba, cnt, data, size); 178 178 free(data); 179 async_answer_0(c allid, rc);180 } 181 182 static void bd_get_block_size_srv(bd_srv_t *srv, cap_call_handle_t c allid,179 async_answer_0(chandle, rc); 180 } 181 182 static void bd_get_block_size_srv(bd_srv_t *srv, cap_call_handle_t chandle, 183 183 ipc_call_t *call) 184 184 { … … 187 187 188 188 if (srv->srvs->ops->get_block_size == NULL) { 189 async_answer_0(c allid, ENOTSUP);189 async_answer_0(chandle, ENOTSUP); 190 190 return; 191 191 } 192 192 193 193 rc = srv->srvs->ops->get_block_size(srv, &block_size); 194 async_answer_1(c allid, rc, block_size);195 } 196 197 static void bd_get_num_blocks_srv(bd_srv_t *srv, cap_call_handle_t c allid,194 async_answer_1(chandle, rc, block_size); 195 } 196 197 static void bd_get_num_blocks_srv(bd_srv_t *srv, cap_call_handle_t chandle, 198 198 ipc_call_t *call) 199 199 { … … 202 202 203 203 if (srv->srvs->ops->get_num_blocks == NULL) { 204 async_answer_0(c allid, ENOTSUP);204 async_answer_0(chandle, ENOTSUP); 205 205 return; 206 206 } 207 207 208 208 rc = srv->srvs->ops->get_num_blocks(srv, &num_blocks); 209 async_answer_2(c allid, rc, LOWER32(num_blocks), UPPER32(num_blocks));209 async_answer_2(chandle, rc, LOWER32(num_blocks), UPPER32(num_blocks)); 210 210 } 211 211 … … 228 228 } 229 229 230 errno_t bd_conn(cap_call_handle_t i id, ipc_call_t *icall, bd_srvs_t *srvs)230 errno_t bd_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, bd_srvs_t *srvs) 231 231 { 232 232 bd_srv_t *srv; … … 234 234 235 235 /* Accept the connection */ 236 async_answer_0(i id, EOK);236 async_answer_0(icall_handle, EOK); 237 237 238 238 srv = bd_srv_create(srvs); … … 252 252 while (true) { 253 253 ipc_call_t call; 254 cap_call_handle_t c allid= async_get_call(&call);254 cap_call_handle_t chandle = async_get_call(&call); 255 255 sysarg_t method = IPC_GET_IMETHOD(call); 256 256 257 257 if (!method) { 258 258 /* The other side has hung up */ 259 async_answer_0(c allid, EOK);259 async_answer_0(chandle, EOK); 260 260 break; 261 261 } … … 263 263 switch (method) { 264 264 case BD_READ_BLOCKS: 265 bd_read_blocks_srv(srv, c allid, &call);265 bd_read_blocks_srv(srv, chandle, &call); 266 266 break; 267 267 case BD_READ_TOC: 268 bd_read_toc_srv(srv, c allid, &call);268 bd_read_toc_srv(srv, chandle, &call); 269 269 break; 270 270 case BD_SYNC_CACHE: 271 bd_sync_cache_srv(srv, c allid, &call);271 bd_sync_cache_srv(srv, chandle, &call); 272 272 break; 273 273 case BD_WRITE_BLOCKS: 274 bd_write_blocks_srv(srv, c allid, &call);274 bd_write_blocks_srv(srv, chandle, &call); 275 275 break; 276 276 case BD_GET_BLOCK_SIZE: 277 bd_get_block_size_srv(srv, c allid, &call);277 bd_get_block_size_srv(srv, chandle, &call); 278 278 break; 279 279 case BD_GET_NUM_BLOCKS: 280 bd_get_num_blocks_srv(srv, c allid, &call);280 bd_get_num_blocks_srv(srv, chandle, &call); 281 281 break; 282 282 default: 283 async_answer_0(c allid, EINVAL);283 async_answer_0(chandle, EINVAL); 284 284 } 285 285 } -
uspace/lib/c/generic/inet.c
r3e242d2 ra46e56b 36 36 #include <stdlib.h> 37 37 38 static void inet_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg);38 static void inet_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg); 39 39 40 40 static async_sess_t *inet_sess = NULL; … … 176 176 } 177 177 178 static void inet_ev_recv(cap_call_handle_t i id, ipc_call_t *icall)178 static void inet_ev_recv(cap_call_handle_t icall_handle, ipc_call_t *icall) 179 179 { 180 180 inet_dgram_t dgram; … … 183 183 dgram.iplink = IPC_GET_ARG2(*icall); 184 184 185 cap_call_handle_t c allid;185 cap_call_handle_t chandle; 186 186 size_t size; 187 if (!async_data_write_receive(&c allid, &size)) {188 async_answer_0(c allid, EINVAL);189 async_answer_0(i id, EINVAL);187 if (!async_data_write_receive(&chandle, &size)) { 188 async_answer_0(chandle, EINVAL); 189 async_answer_0(icall_handle, EINVAL); 190 190 return; 191 191 } 192 192 193 193 if (size != sizeof(inet_addr_t)) { 194 async_answer_0(c allid, EINVAL);195 async_answer_0(i id, EINVAL);196 return; 197 } 198 199 errno_t rc = async_data_write_finalize(c allid, &dgram.src, size);200 if (rc != EOK) { 201 async_answer_0(c allid, rc);202 async_answer_0(i id, rc);203 return; 204 } 205 206 if (!async_data_write_receive(&c allid, &size)) {207 async_answer_0(c allid, EINVAL);208 async_answer_0(i id, EINVAL);194 async_answer_0(chandle, EINVAL); 195 async_answer_0(icall_handle, EINVAL); 196 return; 197 } 198 199 errno_t rc = async_data_write_finalize(chandle, &dgram.src, size); 200 if (rc != EOK) { 201 async_answer_0(chandle, rc); 202 async_answer_0(icall_handle, rc); 203 return; 204 } 205 206 if (!async_data_write_receive(&chandle, &size)) { 207 async_answer_0(chandle, EINVAL); 208 async_answer_0(icall_handle, EINVAL); 209 209 return; 210 210 } 211 211 212 212 if (size != sizeof(inet_addr_t)) { 213 async_answer_0(c allid, EINVAL);214 async_answer_0(i id, EINVAL);215 return; 216 } 217 218 rc = async_data_write_finalize(c allid, &dgram.dest, size);219 if (rc != EOK) { 220 async_answer_0(c allid, rc);221 async_answer_0(i id, rc);213 async_answer_0(chandle, EINVAL); 214 async_answer_0(icall_handle, EINVAL); 215 return; 216 } 217 218 rc = async_data_write_finalize(chandle, &dgram.dest, size); 219 if (rc != EOK) { 220 async_answer_0(chandle, rc); 221 async_answer_0(icall_handle, rc); 222 222 return; 223 223 } … … 225 225 rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, &dgram.size); 226 226 if (rc != EOK) { 227 async_answer_0(i id, rc);227 async_answer_0(icall_handle, rc); 228 228 return; 229 229 } … … 231 231 rc = inet_ev_ops->recv(&dgram); 232 232 free(dgram.data); 233 async_answer_0(i id, rc);234 } 235 236 static void inet_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)233 async_answer_0(icall_handle, rc); 234 } 235 236 static void inet_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 237 237 { 238 238 while (true) { 239 239 ipc_call_t call; 240 cap_call_handle_t c allid= async_get_call(&call);240 cap_call_handle_t chandle = async_get_call(&call); 241 241 242 242 if (!IPC_GET_IMETHOD(call)) { … … 247 247 switch (IPC_GET_IMETHOD(call)) { 248 248 case INET_EV_RECV: 249 inet_ev_recv(c allid, &call);249 inet_ev_recv(chandle, &call); 250 250 break; 251 251 default: 252 async_answer_0(c allid, ENOTSUP);252 async_answer_0(chandle, ENOTSUP); 253 253 } 254 254 } -
uspace/lib/c/generic/inet/tcp.c
r3e242d2 ra46e56b 637 637 * @param icall Call data 638 638 */ 639 static void tcp_ev_connected(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)639 static void tcp_ev_connected(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 640 640 { 641 641 tcp_conn_t *conn; … … 647 647 rc = tcp_conn_get(tcp, conn_id, &conn); 648 648 if (rc != EOK) { 649 async_answer_0(i id, ENOENT);649 async_answer_0(icall_handle, ENOENT); 650 650 return; 651 651 } … … 656 656 fibril_mutex_unlock(&conn->lock); 657 657 658 async_answer_0(i id, EOK);658 async_answer_0(icall_handle, EOK); 659 659 } 660 660 … … 665 665 * @param icall Call data 666 666 */ 667 static void tcp_ev_conn_failed(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)667 static void tcp_ev_conn_failed(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 668 668 { 669 669 tcp_conn_t *conn; … … 675 675 rc = tcp_conn_get(tcp, conn_id, &conn); 676 676 if (rc != EOK) { 677 async_answer_0(i id, ENOENT);677 async_answer_0(icall_handle, ENOENT); 678 678 return; 679 679 } … … 684 684 fibril_mutex_unlock(&conn->lock); 685 685 686 async_answer_0(i id, EOK);686 async_answer_0(icall_handle, EOK); 687 687 } 688 688 … … 693 693 * @param icall Call data 694 694 */ 695 static void tcp_ev_conn_reset(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)695 static void tcp_ev_conn_reset(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 696 696 { 697 697 tcp_conn_t *conn; … … 703 703 rc = tcp_conn_get(tcp, conn_id, &conn); 704 704 if (rc != EOK) { 705 async_answer_0(i id, ENOENT);705 async_answer_0(icall_handle, ENOENT); 706 706 return; 707 707 } … … 712 712 fibril_mutex_unlock(&conn->lock); 713 713 714 async_answer_0(i id, EOK);714 async_answer_0(icall_handle, EOK); 715 715 } 716 716 … … 721 721 * @param icall Call data 722 722 */ 723 static void tcp_ev_data(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)723 static void tcp_ev_data(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 724 724 { 725 725 tcp_conn_t *conn; … … 731 731 rc = tcp_conn_get(tcp, conn_id, &conn); 732 732 if (rc != EOK) { 733 async_answer_0(i id, ENOENT);733 async_answer_0(icall_handle, ENOENT); 734 734 return; 735 735 } … … 741 741 conn->cb->data_avail(conn); 742 742 743 async_answer_0(i id, EOK);743 async_answer_0(icall_handle, EOK); 744 744 } 745 745 … … 750 750 * @param icall Call data 751 751 */ 752 static void tcp_ev_urg_data(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)753 { 754 async_answer_0(i id, ENOTSUP);752 static void tcp_ev_urg_data(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 753 { 754 async_answer_0(icall_handle, ENOTSUP); 755 755 } 756 756 … … 761 761 * @param icall Call data 762 762 */ 763 static void tcp_ev_new_conn(tcp_t *tcp, cap_call_handle_t i id, ipc_call_t *icall)763 static void tcp_ev_new_conn(tcp_t *tcp, cap_call_handle_t icall_handle, ipc_call_t *icall) 764 764 { 765 765 tcp_listener_t *lst; … … 776 776 rc = tcp_listener_get(tcp, lst_id, &lst); 777 777 if (rc != EOK) { 778 async_answer_0(i id, ENOENT);778 async_answer_0(icall_handle, ENOENT); 779 779 return; 780 780 } … … 782 782 rc = tcp_conn_new(tcp, conn_id, lst->cb, lst->cb_arg, &conn); 783 783 if (rc != EOK) { 784 async_answer_0(i id, ENOMEM);784 async_answer_0(icall_handle, ENOMEM); 785 785 return; 786 786 } … … 789 789 cinfo = calloc(1, sizeof(tcp_in_conn_t)); 790 790 if (cinfo == NULL) { 791 async_answer_0(i id, ENOMEM);791 async_answer_0(icall_handle, ENOMEM); 792 792 return; 793 793 } … … 798 798 fid = fibril_create(tcp_conn_fibril, cinfo); 799 799 if (fid == 0) { 800 async_answer_0(i id, ENOMEM);800 async_answer_0(icall_handle, ENOMEM); 801 801 } 802 802 … … 804 804 } 805 805 806 async_answer_0(i id, EOK);806 async_answer_0(icall_handle, EOK); 807 807 } 808 808 … … 813 813 * @param arg Argument, TCP client 814 814 */ 815 static void tcp_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)815 static void tcp_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 816 816 { 817 817 tcp_t *tcp = (tcp_t *)arg; 818 818 819 async_answer_0(i id, EOK);819 async_answer_0(icall_handle, EOK); 820 820 821 821 while (true) { 822 822 ipc_call_t call; 823 cap_call_handle_t c allid= async_get_call(&call);823 cap_call_handle_t chandle = async_get_call(&call); 824 824 825 825 if (!IPC_GET_IMETHOD(call)) { … … 830 830 switch (IPC_GET_IMETHOD(call)) { 831 831 case TCP_EV_CONNECTED: 832 tcp_ev_connected(tcp, c allid, &call);832 tcp_ev_connected(tcp, chandle, &call); 833 833 break; 834 834 case TCP_EV_CONN_FAILED: 835 tcp_ev_conn_failed(tcp, c allid, &call);835 tcp_ev_conn_failed(tcp, chandle, &call); 836 836 break; 837 837 case TCP_EV_CONN_RESET: 838 tcp_ev_conn_reset(tcp, c allid, &call);838 tcp_ev_conn_reset(tcp, chandle, &call); 839 839 break; 840 840 case TCP_EV_DATA: 841 tcp_ev_data(tcp, c allid, &call);841 tcp_ev_data(tcp, chandle, &call); 842 842 break; 843 843 case TCP_EV_URG_DATA: 844 tcp_ev_urg_data(tcp, c allid, &call);844 tcp_ev_urg_data(tcp, chandle, &call); 845 845 break; 846 846 case TCP_EV_NEW_CONN: 847 tcp_ev_new_conn(tcp, c allid, &call);847 tcp_ev_new_conn(tcp, chandle, &call); 848 848 break; 849 849 default: 850 async_answer_0(c allid, ENOTSUP);850 async_answer_0(chandle, ENOTSUP); 851 851 break; 852 852 } -
uspace/lib/c/generic/inet/udp.c
r3e242d2 ra46e56b 455 455 * @param icall IPC message 456 456 */ 457 static void udp_ev_data(udp_t *udp, cap_call_handle_t i id, ipc_call_t *icall)457 static void udp_ev_data(udp_t *udp, cap_call_handle_t icall_handle, ipc_call_t *icall) 458 458 { 459 459 udp_rmsg_t rmsg; … … 481 481 } 482 482 483 async_answer_0(i id, EOK);483 async_answer_0(icall_handle, EOK); 484 484 } 485 485 … … 490 490 * @param arg Argument, UDP client 491 491 */ 492 static void udp_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)492 static void udp_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 493 493 { 494 494 udp_t *udp = (udp_t *)arg; 495 495 496 async_answer_0(i id, EOK);496 async_answer_0(icall_handle, EOK); 497 497 498 498 while (true) { 499 499 ipc_call_t call; 500 cap_call_handle_t c allid= async_get_call(&call);500 cap_call_handle_t chandle = async_get_call(&call); 501 501 502 502 if (!IPC_GET_IMETHOD(call)) { … … 507 507 switch (IPC_GET_IMETHOD(call)) { 508 508 case UDP_EV_DATA: 509 udp_ev_data(udp, c allid, &call);509 udp_ev_data(udp, chandle, &call); 510 510 break; 511 511 default: 512 async_answer_0(c allid, ENOTSUP);512 async_answer_0(chandle, ENOTSUP); 513 513 break; 514 514 } -
uspace/lib/c/generic/inetping.c
r3e242d2 ra46e56b 150 150 } 151 151 152 static void inetping_ev_recv(cap_call_handle_t i id, ipc_call_t *icall)152 static void inetping_ev_recv(cap_call_handle_t icall_handle, ipc_call_t *icall) 153 153 { 154 154 inetping_sdu_t sdu; … … 156 156 sdu.seq_no = IPC_GET_ARG1(*icall); 157 157 158 cap_call_handle_t c allid;158 cap_call_handle_t chandle; 159 159 size_t size; 160 if (!async_data_write_receive(&c allid, &size)) {161 async_answer_0(c allid, EREFUSED);162 async_answer_0(i id, EREFUSED);160 if (!async_data_write_receive(&chandle, &size)) { 161 async_answer_0(chandle, EREFUSED); 162 async_answer_0(icall_handle, EREFUSED); 163 163 return; 164 164 } 165 165 166 166 if (size != sizeof(sdu.src)) { 167 async_answer_0(c allid, EINVAL);168 async_answer_0(i id, EINVAL);169 return; 170 } 171 172 errno_t rc = async_data_write_finalize(c allid, &sdu.src, size);173 if (rc != EOK) { 174 async_answer_0(c allid, rc);175 async_answer_0(i id, rc);176 return; 177 } 178 179 if (!async_data_write_receive(&c allid, &size)) {180 async_answer_0(c allid, EREFUSED);181 async_answer_0(i id, EREFUSED);167 async_answer_0(chandle, EINVAL); 168 async_answer_0(icall_handle, EINVAL); 169 return; 170 } 171 172 errno_t rc = async_data_write_finalize(chandle, &sdu.src, size); 173 if (rc != EOK) { 174 async_answer_0(chandle, rc); 175 async_answer_0(icall_handle, rc); 176 return; 177 } 178 179 if (!async_data_write_receive(&chandle, &size)) { 180 async_answer_0(chandle, EREFUSED); 181 async_answer_0(icall_handle, EREFUSED); 182 182 return; 183 183 } 184 184 185 185 if (size != sizeof(sdu.dest)) { 186 async_answer_0(c allid, EINVAL);187 async_answer_0(i id, EINVAL);188 return; 189 } 190 191 rc = async_data_write_finalize(c allid, &sdu.dest, size);192 if (rc != EOK) { 193 async_answer_0(c allid, rc);194 async_answer_0(i id, rc);186 async_answer_0(chandle, EINVAL); 187 async_answer_0(icall_handle, EINVAL); 188 return; 189 } 190 191 rc = async_data_write_finalize(chandle, &sdu.dest, size); 192 if (rc != EOK) { 193 async_answer_0(chandle, rc); 194 async_answer_0(icall_handle, rc); 195 195 return; 196 196 } … … 198 198 rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size); 199 199 if (rc != EOK) { 200 async_answer_0(i id, rc);200 async_answer_0(icall_handle, rc); 201 201 return; 202 202 } … … 204 204 rc = inetping_ev_ops->recv(&sdu); 205 205 free(sdu.data); 206 async_answer_0(i id, rc);207 } 208 209 static void inetping_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)206 async_answer_0(icall_handle, rc); 207 } 208 209 static void inetping_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 210 210 { 211 211 while (true) { 212 212 ipc_call_t call; 213 cap_call_handle_t c allid= async_get_call(&call);213 cap_call_handle_t chandle = async_get_call(&call); 214 214 215 215 if (!IPC_GET_IMETHOD(call)) { … … 220 220 switch (IPC_GET_IMETHOD(call)) { 221 221 case INETPING_EV_RECV: 222 inetping_ev_recv(c allid, &call);222 inetping_ev_recv(chandle, &call); 223 223 break; 224 224 default: 225 async_answer_0(c allid, ENOTSUP);225 async_answer_0(chandle, ENOTSUP); 226 226 } 227 227 } -
uspace/lib/c/generic/io/chardev_srv.c
r3e242d2 ra46e56b 43 43 static chardev_srv_t *chardev_srv_create(chardev_srvs_t *); 44 44 45 static void chardev_read_srv(chardev_srv_t *srv, cap_call_handle_t c allid,45 static void chardev_read_srv(chardev_srv_t *srv, cap_call_handle_t chandle, 46 46 ipc_call_t *call) 47 47 { … … 50 50 size_t nread; 51 51 errno_t rc; 52 cap_call_handle_t rcall id;52 cap_call_handle_t rcall_handle; 53 53 54 if (!async_data_read_receive(&rcall id, &size)) {55 async_answer_0(c allid, EINVAL);54 if (!async_data_read_receive(&rcall_handle, &size)) { 55 async_answer_0(chandle, EINVAL); 56 56 return; 57 57 } … … 59 59 buf = malloc(size); 60 60 if (buf == NULL) { 61 async_answer_0(rcall id, ENOMEM);62 async_answer_0(c allid, ENOMEM);61 async_answer_0(rcall_handle, ENOMEM); 62 async_answer_0(chandle, ENOMEM); 63 63 return; 64 64 } 65 65 66 66 if (srv->srvs->ops->read == NULL) { 67 async_answer_0(rcall id, ENOTSUP);68 async_answer_0(c allid, ENOTSUP);67 async_answer_0(rcall_handle, ENOTSUP); 68 async_answer_0(chandle, ENOTSUP); 69 69 free(buf); 70 70 return; … … 73 73 rc = srv->srvs->ops->read(srv, buf, size, &nread); 74 74 if (rc != EOK && nread == 0) { 75 async_answer_0(rcall id, rc);76 async_answer_0(c allid, rc);75 async_answer_0(rcall_handle, rc); 76 async_answer_0(chandle, rc); 77 77 free(buf); 78 78 return; 79 79 } 80 80 81 async_data_read_finalize(rcall id, buf, nread);81 async_data_read_finalize(rcall_handle, buf, nread); 82 82 83 83 free(buf); 84 async_answer_2(c allid, EOK, (sysarg_t) rc, nread);84 async_answer_2(chandle, EOK, (sysarg_t) rc, nread); 85 85 } 86 86 87 static void chardev_write_srv(chardev_srv_t *srv, cap_call_handle_t c allid,87 static void chardev_write_srv(chardev_srv_t *srv, cap_call_handle_t chandle, 88 88 ipc_call_t *call) 89 89 { … … 95 95 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); 96 96 if (rc != EOK) { 97 async_answer_0(c allid, rc);97 async_answer_0(chandle, rc); 98 98 return; 99 99 } 100 100 101 101 if (srv->srvs->ops->write == NULL) { 102 async_answer_0(c allid, ENOTSUP);102 async_answer_0(chandle, ENOTSUP); 103 103 return; 104 104 } … … 107 107 free(data); 108 108 if (rc != EOK && nwr == 0) { 109 async_answer_0(c allid, rc);109 async_answer_0(chandle, rc); 110 110 return; 111 111 } 112 112 113 async_answer_2(c allid, EOK, (sysarg_t) rc, nwr);113 async_answer_2(chandle, EOK, (sysarg_t) rc, nwr); 114 114 } 115 115 … … 132 132 } 133 133 134 errno_t chardev_conn(cap_call_handle_t i id, ipc_call_t *icall, chardev_srvs_t *srvs)134 errno_t chardev_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, chardev_srvs_t *srvs) 135 135 { 136 136 chardev_srv_t *srv; … … 138 138 139 139 /* Accept the connection */ 140 async_answer_0(i id, EOK);140 async_answer_0(icall_handle, EOK); 141 141 142 142 srv = chardev_srv_create(srvs); … … 152 152 while (true) { 153 153 ipc_call_t call; 154 cap_call_handle_t c allid= async_get_call(&call);154 cap_call_handle_t chandle = async_get_call(&call); 155 155 sysarg_t method = IPC_GET_IMETHOD(call); 156 156 157 157 if (!method) { 158 158 /* The other side has hung up */ 159 async_answer_0(c allid, EOK);159 async_answer_0(chandle, EOK); 160 160 break; 161 161 } … … 163 163 switch (method) { 164 164 case CHARDEV_READ: 165 chardev_read_srv(srv, c allid, &call);165 chardev_read_srv(srv, chandle, &call); 166 166 break; 167 167 case CHARDEV_WRITE: 168 chardev_write_srv(srv, c allid, &call);168 chardev_write_srv(srv, chandle, &call); 169 169 break; 170 170 default: 171 171 if (srv->srvs->ops->def_handler != NULL) 172 srv->srvs->ops->def_handler(srv, c allid, &call);172 srv->srvs->ops->def_handler(srv, chandle, &call); 173 173 else 174 async_answer_0(c allid, ENOTSUP);174 async_answer_0(chandle, ENOTSUP); 175 175 } 176 176 } -
uspace/lib/c/generic/io/con_srv.c
r3e242d2 ra46e56b 66 66 } 67 67 68 static void con_read_srv(con_srv_t *srv, cap_call_handle_t c allid,68 static void con_read_srv(con_srv_t *srv, cap_call_handle_t chandle, 69 69 ipc_call_t *call) 70 70 { … … 72 72 size_t size; 73 73 errno_t rc; 74 cap_call_handle_t rcall id;75 76 if (!async_data_read_receive(&rcall id, &size)) {77 async_answer_0(c allid, EINVAL);74 cap_call_handle_t rcall_handle; 75 76 if (!async_data_read_receive(&rcall_handle, &size)) { 77 async_answer_0(chandle, EINVAL); 78 78 return; 79 79 } … … 81 81 buf = malloc(size); 82 82 if (buf == NULL) { 83 async_answer_0(rcall id, ENOMEM);84 async_answer_0(c allid, ENOMEM);83 async_answer_0(rcall_handle, ENOMEM); 84 async_answer_0(chandle, ENOMEM); 85 85 return; 86 86 } 87 87 88 88 if (srv->srvs->ops->read == NULL) { 89 async_answer_0(rcall id, ENOTSUP);90 async_answer_0(c allid, ENOTSUP);89 async_answer_0(rcall_handle, ENOTSUP); 90 async_answer_0(chandle, ENOTSUP); 91 91 free(buf); 92 92 return; … … 96 96 rc = srv->srvs->ops->read(srv, buf, size, &nread); 97 97 if (rc != EOK) { 98 async_answer_0(rcall id, rc);99 async_answer_0(c allid, rc);98 async_answer_0(rcall_handle, rc); 99 async_answer_0(chandle, rc); 100 100 free(buf); 101 101 return; 102 102 } 103 103 104 async_data_read_finalize(rcall id, buf, nread);104 async_data_read_finalize(rcall_handle, buf, nread); 105 105 free(buf); 106 106 107 async_answer_1(c allid, EOK, nread);108 } 109 110 static void con_write_srv(con_srv_t *srv, cap_call_handle_t c allid,107 async_answer_1(chandle, EOK, nread); 108 } 109 110 static void con_write_srv(con_srv_t *srv, cap_call_handle_t chandle, 111 111 ipc_call_t *call) 112 112 { … … 117 117 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); 118 118 if (rc != EOK) { 119 async_answer_0(c allid, rc);119 async_answer_0(chandle, rc); 120 120 return; 121 121 } 122 122 123 123 if (srv->srvs->ops->write == NULL) { 124 async_answer_0(c allid, ENOTSUP);124 async_answer_0(chandle, ENOTSUP); 125 125 return; 126 126 } … … 130 130 free(data); 131 131 132 async_answer_1(c allid, rc, nwritten);133 } 134 135 static void con_sync_srv(con_srv_t *srv, cap_call_handle_t c allid,132 async_answer_1(chandle, rc, nwritten); 133 } 134 135 static void con_sync_srv(con_srv_t *srv, cap_call_handle_t chandle, 136 136 ipc_call_t *call) 137 137 { 138 138 if (srv->srvs->ops->sync == NULL) { 139 async_answer_0(c allid, ENOTSUP);139 async_answer_0(chandle, ENOTSUP); 140 140 return; 141 141 } 142 142 143 143 srv->srvs->ops->sync(srv); 144 async_answer_0(c allid, EOK);145 } 146 147 static void con_clear_srv(con_srv_t *srv, cap_call_handle_t c allid,144 async_answer_0(chandle, EOK); 145 } 146 147 static void con_clear_srv(con_srv_t *srv, cap_call_handle_t chandle, 148 148 ipc_call_t *call) 149 149 { 150 150 if (srv->srvs->ops->clear == NULL) { 151 async_answer_0(c allid, ENOTSUP);151 async_answer_0(chandle, ENOTSUP); 152 152 return; 153 153 } 154 154 155 155 srv->srvs->ops->clear(srv); 156 async_answer_0(c allid, EOK);157 } 158 159 static void con_set_pos_srv(con_srv_t *srv, cap_call_handle_t c allid,156 async_answer_0(chandle, EOK); 157 } 158 159 static void con_set_pos_srv(con_srv_t *srv, cap_call_handle_t chandle, 160 160 ipc_call_t *call) 161 161 { … … 167 167 168 168 if (srv->srvs->ops->set_pos == NULL) { 169 async_answer_0(c allid, ENOTSUP);169 async_answer_0(chandle, ENOTSUP); 170 170 return; 171 171 } 172 172 173 173 srv->srvs->ops->set_pos(srv, col, row); 174 async_answer_0(c allid, EOK);175 } 176 177 static void con_get_pos_srv(con_srv_t *srv, cap_call_handle_t c allid,174 async_answer_0(chandle, EOK); 175 } 176 177 static void con_get_pos_srv(con_srv_t *srv, cap_call_handle_t chandle, 178 178 ipc_call_t *call) 179 179 { … … 183 183 184 184 if (srv->srvs->ops->get_pos == NULL) { 185 async_answer_0(c allid, ENOTSUP);185 async_answer_0(chandle, ENOTSUP); 186 186 return; 187 187 } 188 188 189 189 rc = srv->srvs->ops->get_pos(srv, &col, &row); 190 async_answer_2(c allid, rc, col, row);191 } 192 193 static void con_get_size_srv(con_srv_t *srv, cap_call_handle_t c allid,190 async_answer_2(chandle, rc, col, row); 191 } 192 193 static void con_get_size_srv(con_srv_t *srv, cap_call_handle_t chandle, 194 194 ipc_call_t *call) 195 195 { … … 199 199 200 200 if (srv->srvs->ops->get_size == NULL) { 201 async_answer_0(c allid, ENOTSUP);201 async_answer_0(chandle, ENOTSUP); 202 202 return; 203 203 } 204 204 205 205 rc = srv->srvs->ops->get_size(srv, &cols, &rows); 206 async_answer_2(c allid, rc, cols, rows);207 } 208 209 static void con_get_color_cap_srv(con_srv_t *srv, cap_call_handle_t c allid,206 async_answer_2(chandle, rc, cols, rows); 207 } 208 209 static void con_get_color_cap_srv(con_srv_t *srv, cap_call_handle_t chandle, 210 210 ipc_call_t *call) 211 211 { … … 214 214 215 215 if (srv->srvs->ops->get_color_cap == NULL) { 216 async_answer_0(c allid, ENOTSUP);216 async_answer_0(chandle, ENOTSUP); 217 217 return; 218 218 } 219 219 220 220 rc = srv->srvs->ops->get_color_cap(srv, &ccap); 221 async_answer_1(c allid, rc, (sysarg_t)ccap);222 } 223 224 static void con_set_style_srv(con_srv_t *srv, cap_call_handle_t c allid,221 async_answer_1(chandle, rc, (sysarg_t)ccap); 222 } 223 224 static void con_set_style_srv(con_srv_t *srv, cap_call_handle_t chandle, 225 225 ipc_call_t *call) 226 226 { … … 230 230 231 231 if (srv->srvs->ops->set_style == NULL) { 232 async_answer_0(c allid, ENOTSUP);232 async_answer_0(chandle, ENOTSUP); 233 233 return; 234 234 } 235 235 236 236 srv->srvs->ops->set_style(srv, style); 237 async_answer_0(c allid, EOK);238 } 239 240 static void con_set_color_srv(con_srv_t *srv, cap_call_handle_t c allid,237 async_answer_0(chandle, EOK); 238 } 239 240 static void con_set_color_srv(con_srv_t *srv, cap_call_handle_t chandle, 241 241 ipc_call_t *call) 242 242 { … … 250 250 251 251 if (srv->srvs->ops->set_color == NULL) { 252 async_answer_0(c allid, ENOTSUP);252 async_answer_0(chandle, ENOTSUP); 253 253 return; 254 254 } 255 255 256 256 srv->srvs->ops->set_color(srv, bgcolor, fgcolor, flags); 257 async_answer_0(c allid, EOK);258 } 259 260 static void con_set_rgb_color_srv(con_srv_t *srv, cap_call_handle_t c allid,257 async_answer_0(chandle, EOK); 258 } 259 260 static void con_set_rgb_color_srv(con_srv_t *srv, cap_call_handle_t chandle, 261 261 ipc_call_t *call) 262 262 { … … 268 268 269 269 if (srv->srvs->ops->set_rgb_color == NULL) { 270 async_answer_0(c allid, ENOTSUP);270 async_answer_0(chandle, ENOTSUP); 271 271 return; 272 272 } 273 273 274 274 srv->srvs->ops->set_rgb_color(srv, bgcolor, fgcolor); 275 async_answer_0(c allid, EOK);276 } 277 278 static void con_set_cursor_visibility_srv(con_srv_t *srv, cap_call_handle_t c allid,275 async_answer_0(chandle, EOK); 276 } 277 278 static void con_set_cursor_visibility_srv(con_srv_t *srv, cap_call_handle_t chandle, 279 279 ipc_call_t *call) 280 280 { … … 284 284 285 285 if (srv->srvs->ops->set_cursor_visibility == NULL) { 286 async_answer_0(c allid, ENOTSUP);286 async_answer_0(chandle, ENOTSUP); 287 287 return; 288 288 } 289 289 290 290 srv->srvs->ops->set_cursor_visibility(srv, show); 291 async_answer_0(c allid, EOK);292 } 293 294 static void con_get_event_srv(con_srv_t *srv, cap_call_handle_t c allid,291 async_answer_0(chandle, EOK); 292 } 293 294 static void con_get_event_srv(con_srv_t *srv, cap_call_handle_t chandle, 295 295 ipc_call_t *call) 296 296 { … … 300 300 301 301 if (srv->srvs->ops->get_event == NULL) { 302 async_answer_0(c allid, ENOTSUP);302 async_answer_0(chandle, ENOTSUP); 303 303 return; 304 304 } … … 306 306 rc = srv->srvs->ops->get_event(srv, &event); 307 307 if (rc != EOK) { 308 async_answer_0(c allid, rc);308 async_answer_0(chandle, rc); 309 309 return; 310 310 } … … 312 312 rc = console_ev_encode(&event, &result); 313 313 if (rc != EOK) { 314 async_answer_0(c allid, rc);315 return; 316 } 317 318 async_answer_5(c allid, rc, IPC_GET_ARG1(result), IPC_GET_ARG2(result),314 async_answer_0(chandle, rc); 315 return; 316 } 317 318 async_answer_5(chandle, rc, IPC_GET_ARG1(result), IPC_GET_ARG2(result), 319 319 IPC_GET_ARG3(result), IPC_GET_ARG4(result), IPC_GET_ARG5(result)); 320 320 } … … 340 340 } 341 341 342 errno_t con_conn(cap_call_handle_t i id, ipc_call_t *icall, con_srvs_t *srvs)342 errno_t con_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, con_srvs_t *srvs) 343 343 { 344 344 con_srv_t *srv; … … 346 346 347 347 /* Accept the connection */ 348 async_answer_0(i id, EOK);348 async_answer_0(icall_handle, EOK); 349 349 350 350 srv = con_srv_create(srvs); … … 366 366 while (true) { 367 367 ipc_call_t call; 368 cap_call_handle_t c allid= 0;369 370 while (c allid== 0) {368 cap_call_handle_t chandle = 0; 369 370 while (chandle == 0) { 371 371 /* XXX Need to be able to abort immediately */ 372 c allid= async_get_call_timeout(&call,372 chandle = async_get_call_timeout(&call, 373 373 srvs->abort_timeout); 374 374 375 375 if (srv->srvs->aborted) { 376 if (c allid!= 0)377 async_answer_0(c allid, EINTR);376 if (chandle != 0) 377 async_answer_0(chandle, EINTR); 378 378 break; 379 379 } 380 380 } 381 381 382 if (c allid== 0)382 if (chandle == 0) 383 383 break; 384 384 … … 387 387 if (!method) { 388 388 /* The other side has hung up */ 389 async_answer_0(c allid, EOK);389 async_answer_0(chandle, EOK); 390 390 break; 391 391 } … … 393 393 switch (method) { 394 394 case VFS_OUT_READ: 395 con_read_srv(srv, c allid, &call);395 con_read_srv(srv, chandle, &call); 396 396 break; 397 397 case VFS_OUT_WRITE: 398 con_write_srv(srv, c allid, &call);398 con_write_srv(srv, chandle, &call); 399 399 break; 400 400 case VFS_OUT_SYNC: 401 con_sync_srv(srv, c allid, &call);401 con_sync_srv(srv, chandle, &call); 402 402 break; 403 403 case CONSOLE_CLEAR: 404 con_clear_srv(srv, c allid, &call);404 con_clear_srv(srv, chandle, &call); 405 405 break; 406 406 case CONSOLE_SET_POS: 407 con_set_pos_srv(srv, c allid, &call);407 con_set_pos_srv(srv, chandle, &call); 408 408 break; 409 409 case CONSOLE_GET_POS: 410 con_get_pos_srv(srv, c allid, &call);410 con_get_pos_srv(srv, chandle, &call); 411 411 break; 412 412 case CONSOLE_GET_SIZE: 413 con_get_size_srv(srv, c allid, &call);413 con_get_size_srv(srv, chandle, &call); 414 414 break; 415 415 case CONSOLE_GET_COLOR_CAP: 416 con_get_color_cap_srv(srv, c allid, &call);416 con_get_color_cap_srv(srv, chandle, &call); 417 417 break; 418 418 case CONSOLE_SET_STYLE: 419 con_set_style_srv(srv, c allid, &call);419 con_set_style_srv(srv, chandle, &call); 420 420 break; 421 421 case CONSOLE_SET_COLOR: 422 con_set_color_srv(srv, c allid, &call);422 con_set_color_srv(srv, chandle, &call); 423 423 break; 424 424 case CONSOLE_SET_RGB_COLOR: 425 con_set_rgb_color_srv(srv, c allid, &call);425 con_set_rgb_color_srv(srv, chandle, &call); 426 426 break; 427 427 case CONSOLE_SET_CURSOR_VISIBILITY: 428 con_set_cursor_visibility_srv(srv, c allid, &call);428 con_set_cursor_visibility_srv(srv, chandle, &call); 429 429 break; 430 430 case CONSOLE_GET_EVENT: 431 con_get_event_srv(srv, c allid, &call);431 con_get_event_srv(srv, chandle, &call); 432 432 break; 433 433 default: 434 async_answer_0(c allid, ENOTSUP);434 async_answer_0(chandle, ENOTSUP); 435 435 } 436 436 } -
uspace/lib/c/generic/io/input.c
r3e242d2 ra46e56b 43 43 #include <stdlib.h> 44 44 45 static void input_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg);45 static void input_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg); 46 46 47 47 errno_t input_open(async_sess_t *sess, input_ev_ops_t *ev_ops, … … 92 92 } 93 93 94 static void input_ev_active(input_t *input, cap_call_handle_t c allid,94 static void input_ev_active(input_t *input, cap_call_handle_t chandle, 95 95 ipc_call_t *call) 96 96 { 97 97 errno_t rc = input->ev_ops->active(input); 98 async_answer_0(c allid, rc);99 } 100 101 static void input_ev_deactive(input_t *input, cap_call_handle_t c allid,98 async_answer_0(chandle, rc); 99 } 100 101 static void input_ev_deactive(input_t *input, cap_call_handle_t chandle, 102 102 ipc_call_t *call) 103 103 { 104 104 errno_t rc = input->ev_ops->deactive(input); 105 async_answer_0(c allid, rc);106 } 107 108 static void input_ev_key(input_t *input, cap_call_handle_t c allid,105 async_answer_0(chandle, rc); 106 } 107 108 static void input_ev_key(input_t *input, cap_call_handle_t chandle, 109 109 ipc_call_t *call) 110 110 { … … 121 121 122 122 rc = input->ev_ops->key(input, type, key, mods, c); 123 async_answer_0(c allid, rc);124 } 125 126 static void input_ev_move(input_t *input, cap_call_handle_t c allid,123 async_answer_0(chandle, rc); 124 } 125 126 static void input_ev_move(input_t *input, cap_call_handle_t chandle, 127 127 ipc_call_t *call) 128 128 { … … 135 135 136 136 rc = input->ev_ops->move(input, dx, dy); 137 async_answer_0(c allid, rc);138 } 139 140 static void input_ev_abs_move(input_t *input, cap_call_handle_t c allid,137 async_answer_0(chandle, rc); 138 } 139 140 static void input_ev_abs_move(input_t *input, cap_call_handle_t chandle, 141 141 ipc_call_t *call) 142 142 { … … 153 153 154 154 rc = input->ev_ops->abs_move(input, x, y, max_x, max_y); 155 async_answer_0(c allid, rc);156 } 157 158 static void input_ev_button(input_t *input, cap_call_handle_t c allid,155 async_answer_0(chandle, rc); 156 } 157 158 static void input_ev_button(input_t *input, cap_call_handle_t chandle, 159 159 ipc_call_t *call) 160 160 { … … 167 167 168 168 rc = input->ev_ops->button(input, bnum, press); 169 async_answer_0(c allid, rc);170 } 171 172 static void input_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)169 async_answer_0(chandle, rc); 170 } 171 172 static void input_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 173 173 { 174 174 input_t *input = (input_t *)arg; … … 176 176 while (true) { 177 177 ipc_call_t call; 178 cap_call_handle_t c allid= async_get_call(&call);178 cap_call_handle_t chandle = async_get_call(&call); 179 179 180 180 if (!IPC_GET_IMETHOD(call)) { … … 185 185 switch (IPC_GET_IMETHOD(call)) { 186 186 case INPUT_EVENT_ACTIVE: 187 input_ev_active(input, c allid, &call);187 input_ev_active(input, chandle, &call); 188 188 break; 189 189 case INPUT_EVENT_DEACTIVE: 190 input_ev_deactive(input, c allid, &call);190 input_ev_deactive(input, chandle, &call); 191 191 break; 192 192 case INPUT_EVENT_KEY: 193 input_ev_key(input, c allid, &call);193 input_ev_key(input, chandle, &call); 194 194 break; 195 195 case INPUT_EVENT_MOVE: 196 input_ev_move(input, c allid, &call);196 input_ev_move(input, chandle, &call); 197 197 break; 198 198 case INPUT_EVENT_ABS_MOVE: 199 input_ev_abs_move(input, c allid, &call);199 input_ev_abs_move(input, chandle, &call); 200 200 break; 201 201 case INPUT_EVENT_BUTTON: 202 input_ev_button(input, c allid, &call);202 input_ev_button(input, chandle, &call); 203 203 break; 204 204 default: 205 async_answer_0(c allid, ENOTSUP);205 async_answer_0(chandle, ENOTSUP); 206 206 } 207 207 } -
uspace/lib/c/generic/iplink.c
r3e242d2 ra46e56b 45 45 #include <stdlib.h> 46 46 47 static void iplink_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg);47 static void iplink_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg); 48 48 49 49 errno_t iplink_open(async_sess_t *sess, iplink_ev_ops_t *ev_ops, void *arg, … … 245 245 } 246 246 247 static void iplink_ev_recv(iplink_t *iplink, cap_call_handle_t i id,247 static void iplink_ev_recv(iplink_t *iplink, cap_call_handle_t icall_handle, 248 248 ipc_call_t *icall) 249 249 { … … 255 255 &sdu.size); 256 256 if (rc != EOK) { 257 async_answer_0(i id, rc);257 async_answer_0(icall_handle, rc); 258 258 return; 259 259 } … … 261 261 rc = iplink->ev_ops->recv(iplink, &sdu, ver); 262 262 free(sdu.data); 263 async_answer_0(i id, rc);264 } 265 266 static void iplink_ev_change_addr(iplink_t *iplink, cap_call_handle_t i id,263 async_answer_0(icall_handle, rc); 264 } 265 266 static void iplink_ev_change_addr(iplink_t *iplink, cap_call_handle_t icall_handle, 267 267 ipc_call_t *icall) 268 268 { … … 273 273 sizeof(addr48_t), sizeof(addr48_t), 0, &size); 274 274 if (rc != EOK) { 275 async_answer_0(i id, rc);275 async_answer_0(icall_handle, rc); 276 276 return; 277 277 } … … 279 279 rc = iplink->ev_ops->change_addr(iplink, *addr); 280 280 free(addr); 281 async_answer_0(i id, EOK);282 } 283 284 static void iplink_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)281 async_answer_0(icall_handle, EOK); 282 } 283 284 static void iplink_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 285 285 { 286 286 iplink_t *iplink = (iplink_t *) arg; … … 288 288 while (true) { 289 289 ipc_call_t call; 290 cap_call_handle_t c allid= async_get_call(&call);290 cap_call_handle_t chandle = async_get_call(&call); 291 291 292 292 if (!IPC_GET_IMETHOD(call)) { … … 297 297 switch (IPC_GET_IMETHOD(call)) { 298 298 case IPLINK_EV_RECV: 299 iplink_ev_recv(iplink, c allid, &call);299 iplink_ev_recv(iplink, chandle, &call); 300 300 break; 301 301 case IPLINK_EV_CHANGE_ADDR: 302 iplink_ev_change_addr(iplink, c allid, &call);302 iplink_ev_change_addr(iplink, chandle, &call); 303 303 break; 304 304 default: 305 async_answer_0(c allid, ENOTSUP);305 async_answer_0(chandle, ENOTSUP); 306 306 } 307 307 } -
uspace/lib/c/generic/iplink_srv.c
r3e242d2 ra46e56b 42 42 #include <inet/iplink_srv.h> 43 43 44 static void iplink_get_mtu_srv(iplink_srv_t *srv, cap_call_handle_t c allid,44 static void iplink_get_mtu_srv(iplink_srv_t *srv, cap_call_handle_t chandle, 45 45 ipc_call_t *call) 46 46 { 47 47 size_t mtu; 48 48 errno_t rc = srv->ops->get_mtu(srv, &mtu); 49 async_answer_1(c allid, rc, mtu);50 } 51 52 static void iplink_get_mac48_srv(iplink_srv_t *srv, cap_call_handle_t i id,49 async_answer_1(chandle, rc, mtu); 50 } 51 52 static void iplink_get_mac48_srv(iplink_srv_t *srv, cap_call_handle_t icall_handle, 53 53 ipc_call_t *icall) 54 54 { … … 56 56 errno_t rc = srv->ops->get_mac48(srv, &mac); 57 57 if (rc != EOK) { 58 async_answer_0(i id, rc);59 return; 60 } 61 62 cap_call_handle_t c allid;63 size_t size; 64 if (!async_data_read_receive(&c allid, &size)) {65 async_answer_0(c allid, EREFUSED);66 async_answer_0(i id, EREFUSED);58 async_answer_0(icall_handle, rc); 59 return; 60 } 61 62 cap_call_handle_t chandle; 63 size_t size; 64 if (!async_data_read_receive(&chandle, &size)) { 65 async_answer_0(chandle, EREFUSED); 66 async_answer_0(icall_handle, EREFUSED); 67 67 return; 68 68 } 69 69 70 70 if (size != sizeof(addr48_t)) { 71 async_answer_0(c allid, EINVAL);72 async_answer_0(i id, EINVAL);73 return; 74 } 75 76 rc = async_data_read_finalize(c allid, &mac, size);71 async_answer_0(chandle, EINVAL); 72 async_answer_0(icall_handle, EINVAL); 73 return; 74 } 75 76 rc = async_data_read_finalize(chandle, &mac, size); 77 77 if (rc != EOK) 78 async_answer_0(c allid, rc);79 80 async_answer_0(i id, rc);81 } 82 83 static void iplink_set_mac48_srv(iplink_srv_t *srv, cap_call_handle_t i id,78 async_answer_0(chandle, rc); 79 80 async_answer_0(icall_handle, rc); 81 } 82 83 static void iplink_set_mac48_srv(iplink_srv_t *srv, cap_call_handle_t icall_handle, 84 84 ipc_call_t *icall) 85 85 { … … 87 87 size_t size; 88 88 addr48_t mac; 89 cap_call_handle_t c allid;90 91 if (!async_data_write_receive(&c allid, &size)) {92 async_answer_0(c allid, EREFUSED);93 async_answer_0(i id, EREFUSED);89 cap_call_handle_t chandle; 90 91 if (!async_data_write_receive(&chandle, &size)) { 92 async_answer_0(chandle, EREFUSED); 93 async_answer_0(icall_handle, EREFUSED); 94 94 } 95 95 96 96 rc = srv->ops->set_mac48(srv, &mac); 97 97 if (rc != EOK) { 98 async_answer_0(i id, rc);99 return; 100 } 101 102 rc = async_data_read_finalize(c allid, &mac, sizeof(addr48_t));98 async_answer_0(icall_handle, rc); 99 return; 100 } 101 102 rc = async_data_read_finalize(chandle, &mac, sizeof(addr48_t)); 103 103 if (rc != EOK) 104 async_answer_0(c allid, rc);105 106 async_answer_0(i id, rc);107 } 108 109 static void iplink_addr_add_srv(iplink_srv_t *srv, cap_call_handle_t i id,110 ipc_call_t *icall) 111 { 112 cap_call_handle_t c allid;113 size_t size; 114 if (!async_data_write_receive(&c allid, &size)) {115 async_answer_0(c allid, EREFUSED);116 async_answer_0(i id, EREFUSED);104 async_answer_0(chandle, rc); 105 106 async_answer_0(icall_handle, rc); 107 } 108 109 static void iplink_addr_add_srv(iplink_srv_t *srv, cap_call_handle_t icall_handle, 110 ipc_call_t *icall) 111 { 112 cap_call_handle_t chandle; 113 size_t size; 114 if (!async_data_write_receive(&chandle, &size)) { 115 async_answer_0(chandle, EREFUSED); 116 async_answer_0(icall_handle, EREFUSED); 117 117 return; 118 118 } 119 119 120 120 if (size != sizeof(inet_addr_t)) { 121 async_answer_0(c allid, EINVAL);122 async_answer_0(i id, EINVAL);121 async_answer_0(chandle, EINVAL); 122 async_answer_0(icall_handle, EINVAL); 123 123 return; 124 124 } 125 125 126 126 inet_addr_t addr; 127 errno_t rc = async_data_write_finalize(c allid, &addr, size);128 if (rc != EOK) { 129 async_answer_0(c allid, rc);130 async_answer_0(i id, rc);127 errno_t rc = async_data_write_finalize(chandle, &addr, size); 128 if (rc != EOK) { 129 async_answer_0(chandle, rc); 130 async_answer_0(icall_handle, rc); 131 131 } 132 132 133 133 rc = srv->ops->addr_add(srv, &addr); 134 async_answer_0(i id, rc);135 } 136 137 static void iplink_addr_remove_srv(iplink_srv_t *srv, cap_call_handle_t i id,138 ipc_call_t *icall) 139 { 140 cap_call_handle_t c allid;141 size_t size; 142 if (!async_data_write_receive(&c allid, &size)) {143 async_answer_0(c allid, EREFUSED);144 async_answer_0(i id, EREFUSED);134 async_answer_0(icall_handle, rc); 135 } 136 137 static void iplink_addr_remove_srv(iplink_srv_t *srv, cap_call_handle_t icall_handle, 138 ipc_call_t *icall) 139 { 140 cap_call_handle_t chandle; 141 size_t size; 142 if (!async_data_write_receive(&chandle, &size)) { 143 async_answer_0(chandle, EREFUSED); 144 async_answer_0(icall_handle, EREFUSED); 145 145 return; 146 146 } 147 147 148 148 if (size != sizeof(inet_addr_t)) { 149 async_answer_0(c allid, EINVAL);150 async_answer_0(i id, EINVAL);149 async_answer_0(chandle, EINVAL); 150 async_answer_0(icall_handle, EINVAL); 151 151 return; 152 152 } 153 153 154 154 inet_addr_t addr; 155 errno_t rc = async_data_write_finalize(c allid, &addr, size);156 if (rc != EOK) { 157 async_answer_0(c allid, rc);158 async_answer_0(i id, rc);155 errno_t rc = async_data_write_finalize(chandle, &addr, size); 156 if (rc != EOK) { 157 async_answer_0(chandle, rc); 158 async_answer_0(icall_handle, rc); 159 159 } 160 160 161 161 rc = srv->ops->addr_remove(srv, &addr); 162 async_answer_0(i id, rc);163 } 164 165 static void iplink_send_srv(iplink_srv_t *srv, cap_call_handle_t i id,162 async_answer_0(icall_handle, rc); 163 } 164 165 static void iplink_send_srv(iplink_srv_t *srv, cap_call_handle_t icall_handle, 166 166 ipc_call_t *icall) 167 167 { … … 174 174 &sdu.size); 175 175 if (rc != EOK) { 176 async_answer_0(i id, rc);176 async_answer_0(icall_handle, rc); 177 177 return; 178 178 } … … 180 180 rc = srv->ops->send(srv, &sdu); 181 181 free(sdu.data); 182 async_answer_0(i id, rc);183 } 184 185 static void iplink_send6_srv(iplink_srv_t *srv, cap_call_handle_t i id,182 async_answer_0(icall_handle, rc); 183 } 184 185 static void iplink_send6_srv(iplink_srv_t *srv, cap_call_handle_t icall_handle, 186 186 ipc_call_t *icall) 187 187 { 188 188 iplink_sdu6_t sdu; 189 189 190 cap_call_handle_t c allid;191 size_t size; 192 if (!async_data_write_receive(&c allid, &size)) {193 async_answer_0(c allid, EREFUSED);194 async_answer_0(i id, EREFUSED);190 cap_call_handle_t chandle; 191 size_t size; 192 if (!async_data_write_receive(&chandle, &size)) { 193 async_answer_0(chandle, EREFUSED); 194 async_answer_0(icall_handle, EREFUSED); 195 195 return; 196 196 } 197 197 198 198 if (size != sizeof(addr48_t)) { 199 async_answer_0(c allid, EINVAL);200 async_answer_0(i id, EINVAL);201 return; 202 } 203 204 errno_t rc = async_data_write_finalize(c allid, &sdu.dest, size);205 if (rc != EOK) { 206 async_answer_0(c allid, rc);207 async_answer_0(i id, rc);199 async_answer_0(chandle, EINVAL); 200 async_answer_0(icall_handle, EINVAL); 201 return; 202 } 203 204 errno_t rc = async_data_write_finalize(chandle, &sdu.dest, size); 205 if (rc != EOK) { 206 async_answer_0(chandle, rc); 207 async_answer_0(icall_handle, rc); 208 208 } 209 209 … … 211 211 &sdu.size); 212 212 if (rc != EOK) { 213 async_answer_0(i id, rc);213 async_answer_0(icall_handle, rc); 214 214 return; 215 215 } … … 217 217 rc = srv->ops->send6(srv, &sdu); 218 218 free(sdu.data); 219 async_answer_0(i id, rc);219 async_answer_0(icall_handle, rc); 220 220 } 221 221 … … 229 229 } 230 230 231 errno_t iplink_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)231 errno_t iplink_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 232 232 { 233 233 iplink_srv_t *srv = (iplink_srv_t *) arg; … … 237 237 if (srv->connected) { 238 238 fibril_mutex_unlock(&srv->lock); 239 async_answer_0(i id, EBUSY);239 async_answer_0(icall_handle, EBUSY); 240 240 return EBUSY; 241 241 } … … 245 245 246 246 /* Accept the connection */ 247 async_answer_0(i id, EOK);247 async_answer_0(icall_handle, EOK); 248 248 249 249 async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE); … … 259 259 while (true) { 260 260 ipc_call_t call; 261 cap_call_handle_t c allid= async_get_call(&call);261 cap_call_handle_t chandle = async_get_call(&call); 262 262 sysarg_t method = IPC_GET_IMETHOD(call); 263 263 … … 267 267 srv->connected = false; 268 268 fibril_mutex_unlock(&srv->lock); 269 async_answer_0(c allid, EOK);269 async_answer_0(chandle, EOK); 270 270 break; 271 271 } … … 273 273 switch (method) { 274 274 case IPLINK_GET_MTU: 275 iplink_get_mtu_srv(srv, c allid, &call);275 iplink_get_mtu_srv(srv, chandle, &call); 276 276 break; 277 277 case IPLINK_GET_MAC48: 278 iplink_get_mac48_srv(srv, c allid, &call);278 iplink_get_mac48_srv(srv, chandle, &call); 279 279 break; 280 280 case IPLINK_SET_MAC48: 281 iplink_set_mac48_srv(srv, c allid, &call);281 iplink_set_mac48_srv(srv, chandle, &call); 282 282 break; 283 283 case IPLINK_SEND: 284 iplink_send_srv(srv, c allid, &call);284 iplink_send_srv(srv, chandle, &call); 285 285 break; 286 286 case IPLINK_SEND6: 287 iplink_send6_srv(srv, c allid, &call);287 iplink_send6_srv(srv, chandle, &call); 288 288 break; 289 289 case IPLINK_ADDR_ADD: 290 iplink_addr_add_srv(srv, c allid, &call);290 iplink_addr_add_srv(srv, chandle, &call); 291 291 break; 292 292 case IPLINK_ADDR_REMOVE: 293 iplink_addr_remove_srv(srv, c allid, &call);293 iplink_addr_remove_srv(srv, chandle, &call); 294 294 break; 295 295 default: 296 async_answer_0(c allid, EINVAL);296 async_answer_0(chandle, EINVAL); 297 297 } 298 298 } -
uspace/lib/c/generic/loc.c
r3e242d2 ra46e56b 55 55 static async_sess_t *loc_consumer_sess = NULL; 56 56 57 static void loc_cb_conn(cap_call_handle_t i id, ipc_call_t *icall, void *arg)57 static void loc_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 58 58 { 59 59 while (true) { 60 60 ipc_call_t call; 61 cap_call_handle_t c allid= async_get_call(&call);61 cap_call_handle_t chandle = async_get_call(&call); 62 62 63 63 if (!IPC_GET_IMETHOD(call)) { … … 72 72 fibril_mutex_unlock(&loc_callback_mutex); 73 73 74 async_answer_0(c allid, EOK);74 async_answer_0(chandle, EOK); 75 75 76 76 if (cb_fun != NULL) … … 79 79 break; 80 80 default: 81 async_answer_0(c allid, ENOTSUP);81 async_answer_0(chandle, ENOTSUP); 82 82 } 83 83 } -
uspace/lib/c/generic/vfs/vfs.c
r3e242d2 ra46e56b 802 802 errno_t vfs_receive_handle(bool high, int *handle) 803 803 { 804 cap_call_handle_t c allid;805 if (!async_state_change_receive(&c allid, NULL, NULL, NULL)) {806 async_answer_0(c allid, EINVAL);804 cap_call_handle_t chandle; 805 if (!async_state_change_receive(&chandle, NULL, NULL, NULL)) { 806 async_answer_0(chandle, EINVAL); 807 807 return EINVAL; 808 808 } … … 810 810 async_exch_t *vfs_exch = vfs_exchange_begin(); 811 811 812 async_state_change_finalize(c allid, vfs_exch);812 async_state_change_finalize(chandle, vfs_exch); 813 813 814 814 sysarg_t ret;
Note:
See TracChangeset
for help on using the changeset viewer.
