Changeset 984a9ba in mainline for uspace/srv/hid
- Timestamp:
- 2018-07-05T09:34:09Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63d46341
- Parents:
- 76f566d
- Location:
- uspace/srv/hid
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/compositor/compositor.c
r76f566d r984a9ba 602 602 } 603 603 604 static void comp_window_get_event(window_t *win, cap_call_handle_t icall_handle,ipc_call_t *icall)604 static void comp_window_get_event(window_t *win, ipc_call_t *icall) 605 605 { 606 606 window_event_t *event = (window_event_t *) prodcons_consume(&win->queue); 607 607 608 cap_call_handle_t chandle;608 ipc_call_t call; 609 609 size_t len; 610 610 611 if (!async_data_read_receive(&c handle, &len)) {612 async_answer_0(icall _handle, EINVAL);611 if (!async_data_read_receive(&call, &len)) { 612 async_answer_0(icall, EINVAL); 613 613 free(event); 614 614 return; 615 615 } 616 616 617 errno_t rc = async_data_read_finalize( chandle, event, len);617 errno_t rc = async_data_read_finalize(&call, event, len); 618 618 if (rc != EOK) { 619 async_answer_0(icall _handle, ENOMEM);619 async_answer_0(icall, ENOMEM); 620 620 free(event); 621 621 return; 622 622 } 623 623 624 async_answer_0(icall _handle, EOK);624 async_answer_0(icall, EOK); 625 625 free(event); 626 626 } 627 627 628 static void comp_window_damage(window_t *win, cap_call_handle_t icall_handle,ipc_call_t *icall)628 static void comp_window_damage(window_t *win, ipc_call_t *icall) 629 629 { 630 630 double x = IPC_GET_ARG1(*icall); … … 644 644 } 645 645 646 async_answer_0(icall _handle, EOK);647 } 648 649 static void comp_window_grab(window_t *win, cap_call_handle_t icall_handle,ipc_call_t *icall)646 async_answer_0(icall, EOK); 647 } 648 649 static void comp_window_grab(window_t *win, ipc_call_t *icall) 650 650 { 651 651 sysarg_t pos_id = IPC_GET_ARG1(*icall); … … 674 674 } 675 675 676 async_answer_0(icall _handle, EOK);676 async_answer_0(icall, EOK); 677 677 } 678 678 … … 706 706 } 707 707 708 static void comp_window_resize(window_t *win, cap_call_handle_t icall_handle,ipc_call_t *icall)709 { 710 cap_call_handle_t chandle;708 static void comp_window_resize(window_t *win, ipc_call_t *icall) 709 { 710 ipc_call_t call; 711 711 size_t size; 712 712 unsigned int flags; 713 713 714 714 /* Start sharing resized window with client. */ 715 if (!async_share_out_receive(&c handle, &size, &flags)) {716 async_answer_0(icall _handle, EINVAL);715 if (!async_share_out_receive(&call, &size, &flags)) { 716 async_answer_0(icall, EINVAL); 717 717 return; 718 718 } 719 719 720 720 void *new_cell_storage; 721 errno_t rc = async_share_out_finalize( chandle, &new_cell_storage);721 errno_t rc = async_share_out_finalize(&call, &new_cell_storage); 722 722 if ((rc != EOK) || (new_cell_storage == AS_MAP_FAILED)) { 723 async_answer_0(icall _handle, ENOMEM);723 async_answer_0(icall, ENOMEM); 724 724 return; 725 725 } … … 730 730 if (!new_surface) { 731 731 as_area_destroy(new_cell_storage); 732 async_answer_0(icall _handle, ENOMEM);732 async_answer_0(icall, ENOMEM); 733 733 return; 734 734 } … … 817 817 comp_damage(x, y, width, height); 818 818 819 async_answer_0(icall _handle, EOK);819 async_answer_0(icall, EOK); 820 820 } 821 821 … … 849 849 } 850 850 851 static void comp_window_close(window_t *win, cap_call_handle_t icall_handle,ipc_call_t *icall)851 static void comp_window_close(window_t *win, ipc_call_t *icall) 852 852 { 853 853 /* Stop managing the window. */ … … 891 891 892 892 comp_damage(x, y, width, height); 893 async_answer_0(icall _handle, EOK);894 } 895 896 static void comp_window_close_request(window_t *win, cap_call_handle_t icall_handle,ipc_call_t *icall)893 async_answer_0(icall, EOK); 894 } 895 896 static void comp_window_close_request(window_t *win, ipc_call_t *icall) 897 897 { 898 898 window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t)); 899 899 if (event == NULL) { 900 async_answer_0(icall _handle, ENOMEM);900 async_answer_0(icall, ENOMEM); 901 901 return; 902 902 } … … 906 906 907 907 prodcons_produce(&win->queue, &event->link); 908 async_answer_0(icall _handle, EOK);909 } 910 911 static void client_connection( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)908 async_answer_0(icall, EOK); 909 } 910 911 static void client_connection(ipc_call_t *icall, void *arg) 912 912 { 913 913 ipc_call_t call; 914 cap_call_handle_t chandle;915 914 service_id_t service_id = (service_id_t) IPC_GET_ARG2(*icall); 916 915 917 916 /* Allocate resources for new window and register it to the location service. */ 918 917 if (service_id == winreg_id) { 919 async_answer_0(icall _handle, EOK);920 921 chandle =async_get_call(&call);918 async_answer_0(icall, EOK); 919 920 async_get_call(&call); 922 921 if (IPC_GET_IMETHOD(call) == WINDOW_REGISTER) { 923 922 fibril_mutex_lock(&window_list_mtx); … … 925 924 window_t *win = window_create(); 926 925 if (!win) { 927 async_answer_2( chandle, ENOMEM, 0, 0);926 async_answer_2(&call, ENOMEM, 0, 0); 928 927 fibril_mutex_unlock(&window_list_mtx); 929 928 return; … … 944 943 if (loc_service_register(name_in, &win->in_dsid) != EOK) { 945 944 window_destroy(win); 946 async_answer_2( chandle, EINVAL, 0, 0);945 async_answer_2(&call, EINVAL, 0, 0); 947 946 fibril_mutex_unlock(&window_list_mtx); 948 947 return; … … 952 951 loc_service_unregister(win->in_dsid); 953 952 window_destroy(win); 954 async_answer_2( chandle, EINVAL, 0, 0);953 async_answer_2(&call, EINVAL, 0, 0); 955 954 fibril_mutex_unlock(&window_list_mtx); 956 955 return; … … 966 965 } 967 966 968 async_answer_2( chandle, EOK, win->in_dsid, win->out_dsid);967 async_answer_2(&call, EOK, win->in_dsid, win->out_dsid); 969 968 fibril_mutex_unlock(&window_list_mtx); 970 969 … … 975 974 return; 976 975 } else { 977 async_answer_0( chandle, EINVAL);976 async_answer_0(&call, EINVAL); 978 977 return; 979 978 } … … 993 992 if (win) { 994 993 atomic_inc(&win->ref_cnt); 995 async_answer_0(icall _handle, EOK);994 async_answer_0(icall, EOK); 996 995 } else { 997 async_answer_0(icall _handle, EINVAL);996 async_answer_0(icall, EINVAL); 998 997 return; 999 998 } … … 1002 1001 if (win->in_dsid == service_id) { 1003 1002 while (true) { 1004 chandle =async_get_call(&call);1003 async_get_call(&call); 1005 1004 1006 1005 if (!IPC_GET_IMETHOD(call)) { 1007 async_answer_0( chandle, EOK);1006 async_answer_0(&call, EOK); 1008 1007 atomic_dec(&win->ref_cnt); 1009 1008 window_destroy(win); … … 1013 1012 switch (IPC_GET_IMETHOD(call)) { 1014 1013 case WINDOW_GET_EVENT: 1015 comp_window_get_event(win, chandle,&call);1014 comp_window_get_event(win, &call); 1016 1015 break; 1017 1016 default: 1018 async_answer_0( chandle, EINVAL);1017 async_answer_0(&call, EINVAL); 1019 1018 } 1020 1019 } 1021 1020 } else if (win->out_dsid == service_id) { 1022 1021 while (true) { 1023 chandle =async_get_call(&call);1022 async_get_call(&call); 1024 1023 1025 1024 if (!IPC_GET_IMETHOD(call)) { 1026 comp_window_close(win, chandle,&call);1025 comp_window_close(win, &call); 1027 1026 atomic_dec(&win->ref_cnt); 1028 1027 window_destroy(win); … … 1032 1031 switch (IPC_GET_IMETHOD(call)) { 1033 1032 case WINDOW_DAMAGE: 1034 comp_window_damage(win, chandle,&call);1033 comp_window_damage(win, &call); 1035 1034 break; 1036 1035 case WINDOW_GRAB: 1037 comp_window_grab(win, chandle,&call);1036 comp_window_grab(win, &call); 1038 1037 break; 1039 1038 case WINDOW_RESIZE: 1040 comp_window_resize(win, chandle,&call);1039 comp_window_resize(win, &call); 1041 1040 break; 1042 1041 case WINDOW_CLOSE: … … 1045 1044 * the case when the client is killed abruptly. 1046 1045 */ 1047 async_answer_0( chandle, EOK);1046 async_answer_0(&call, EOK); 1048 1047 break; 1049 1048 case WINDOW_CLOSE_REQUEST: 1050 comp_window_close_request(win, chandle,&call);1049 comp_window_close_request(win, &call); 1051 1050 break; 1052 1051 default: 1053 async_answer_0( chandle, EINVAL);1054 } 1055 } 1056 } 1057 } 1058 1059 static void comp_mode_change(viewport_t *vp, cap_call_handle_t icall_handle,ipc_call_t *icall)1052 async_answer_0(&call, EINVAL); 1053 } 1054 } 1055 } 1056 } 1057 1058 static void comp_mode_change(viewport_t *vp, ipc_call_t *icall) 1060 1059 { 1061 1060 sysarg_t mode_idx = IPC_GET_ARG2(*icall); … … 1067 1066 if (rc != EOK) { 1068 1067 fibril_mutex_unlock(&viewport_list_mtx); 1069 async_answer_0(icall _handle, EINVAL);1068 async_answer_0(icall, EINVAL); 1070 1069 return; 1071 1070 } … … 1076 1075 if (!new_surface) { 1077 1076 fibril_mutex_unlock(&viewport_list_mtx); 1078 async_answer_0(icall _handle, ENOMEM);1077 async_answer_0(icall, ENOMEM); 1079 1078 return; 1080 1079 } … … 1086 1085 surface_destroy(new_surface); 1087 1086 fibril_mutex_unlock(&viewport_list_mtx); 1088 async_answer_0(icall _handle, rc);1087 async_answer_0(icall, rc); 1089 1088 return; 1090 1089 } … … 1096 1095 1097 1096 fibril_mutex_unlock(&viewport_list_mtx); 1098 async_answer_0(icall _handle, EOK);1097 async_answer_0(icall, EOK); 1099 1098 1100 1099 comp_restrict_pointers(); … … 1130 1129 fibril_mutex_unlock(&window_list_mtx); 1131 1130 1132 async_answer_0(icall _handle, EOK);1131 async_answer_0(icall, EOK); 1133 1132 1134 1133 /* All fibrils of the compositor will terminate soon. */ … … 1136 1135 #endif 1137 1136 1138 static void comp_visualizer_disconnect(viewport_t *vp, cap_call_handle_t icall_handle,ipc_call_t *icall)1137 static void comp_visualizer_disconnect(viewport_t *vp, ipc_call_t *icall) 1139 1138 { 1140 1139 /* Release viewport resources. */ … … 1146 1145 fibril_mutex_unlock(&viewport_list_mtx); 1147 1146 1148 async_answer_0(icall _handle, EOK);1147 async_answer_0(icall, EOK); 1149 1148 1150 1149 comp_restrict_pointers(); … … 1152 1151 } 1153 1152 1154 static void vsl_notifications( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)1153 static void vsl_notifications(ipc_call_t *icall, void *arg) 1155 1154 { 1156 1155 viewport_t *vp = NULL; … … 1170 1169 while (true) { 1171 1170 ipc_call_t call; 1172 cap_call_handle_t chandle =async_get_call(&call);1171 async_get_call(&call); 1173 1172 1174 1173 if (!IPC_GET_IMETHOD(call)) { … … 1179 1178 switch (IPC_GET_IMETHOD(call)) { 1180 1179 case VISUALIZER_MODE_CHANGE: 1181 comp_mode_change(vp, chandle,&call);1180 comp_mode_change(vp, &call); 1182 1181 break; 1183 1182 case VISUALIZER_DISCONNECT: 1184 comp_visualizer_disconnect(vp, chandle,&call);1183 comp_visualizer_disconnect(vp, &call); 1185 1184 return; 1186 1185 default: 1187 async_answer_0( chandle, EINVAL);1186 async_answer_0(&call, EINVAL); 1188 1187 } 1189 1188 } -
uspace/srv/hid/compositor/compositor.h
r76f566d r984a9ba 37 37 38 38 typedef native_t desktop_coord_t; 39 39 40 typedef struct { 40 41 desktop_coord_t x; 41 42 desktop_coord_t y; 42 43 } desktop_point_t; 44 43 45 typedef desktop_point_t desktop_vector_t; 44 46 … … 55 57 double y; 56 58 } double_point_t; 59 57 60 typedef double_point_t double_vector_t; 58 61 -
uspace/srv/hid/console/console.c
r76f566d r984a9ba 507 507 } 508 508 509 static void client_connection( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)509 static void client_connection(ipc_call_t *icall, void *arg) 510 510 { 511 511 console_t *cons = NULL; … … 519 519 520 520 if (cons == NULL) { 521 async_answer_0(icall _handle, ENOENT);521 async_answer_0(icall, ENOENT); 522 522 return; 523 523 } … … 526 526 cons_set_cursor_vis(cons, true); 527 527 528 con_conn(icall _handle, icall, &cons->srvs);528 con_conn(icall, &cons->srvs); 529 529 } 530 530 -
uspace/srv/hid/input/ctl/kbdev.c
r76f566d r984a9ba 54 54 static void kbdev_ctl_set_ind(kbd_dev_t *, unsigned int); 55 55 56 static void kbdev_callback_conn( cap_call_handle_t,ipc_call_t *, void *arg);56 static void kbdev_callback_conn(ipc_call_t *, void *arg); 57 57 58 58 kbd_ctl_ops_t kbdev_ctl = { … … 147 147 } 148 148 149 static void kbdev_callback_conn( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)149 static void kbdev_callback_conn(ipc_call_t *icall, void *arg) 150 150 { 151 151 kbdev_t *kbdev; … … 158 158 while (true) { 159 159 ipc_call_t call; 160 cap_call_handle_t chandle;160 async_get_call(&call); 161 161 162 chandle = async_get_call(&call);163 162 if (!IPC_GET_IMETHOD(call)) { 164 163 kbdev_destroy(kbdev); … … 179 178 } 180 179 181 async_answer_0( chandle, retval);180 async_answer_0(&call, retval); 182 181 } 183 182 } -
uspace/srv/hid/input/input.c
r76f566d r984a9ba 320 320 321 321 /** New client connection */ 322 static void client_connection( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)322 static void client_connection(ipc_call_t *icall, void *arg) 323 323 { 324 324 client_t *client = (client_t *) async_get_client_data(); 325 325 if (client == NULL) { 326 async_answer_0(icall _handle, ENOMEM);326 async_answer_0(icall, ENOMEM); 327 327 return; 328 328 } 329 329 330 async_answer_0(icall _handle, EOK);330 async_answer_0(icall, EOK); 331 331 332 332 while (true) { 333 333 ipc_call_t call; 334 cap_call_handle_t chandle =async_get_call(&call);334 async_get_call(&call); 335 335 336 336 if (!IPC_GET_IMETHOD(call)) { … … 340 340 } 341 341 342 async_answer_0( chandle, EOK);342 async_answer_0(&call, EOK); 343 343 return; 344 344 } … … 349 349 if (client->sess == NULL) { 350 350 client->sess = sess; 351 async_answer_0( chandle, EOK);351 async_answer_0(&call, EOK); 352 352 } else 353 async_answer_0( chandle, ELIMIT);353 async_answer_0(&call, ELIMIT); 354 354 } else { 355 355 switch (IPC_GET_IMETHOD(call)) { … … 357 357 active_client = client; 358 358 client_arbitration(); 359 async_answer_0( chandle, EOK);359 async_answer_0(&call, EOK); 360 360 break; 361 361 default: 362 async_answer_0( chandle, EINVAL);362 async_answer_0(&call, EINVAL); 363 363 } 364 364 } -
uspace/srv/hid/input/proto/mousedev.c
r76f566d r984a9ba 70 70 } 71 71 72 static void mousedev_callback_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, 73 void *arg) 72 static void mousedev_callback_conn(ipc_call_t *icall, void *arg) 74 73 { 75 74 /* Mousedev device structure */ … … 78 77 while (true) { 79 78 ipc_call_t call; 80 cap_call_handle_t chandle =async_get_call(&call);79 async_get_call(&call); 81 80 82 81 if (!IPC_GET_IMETHOD(call)) { … … 110 109 } 111 110 112 async_answer_0( chandle, retval);111 async_answer_0(&call, retval); 113 112 } 114 113 } -
uspace/srv/hid/isdv4_tablet/main.c
r76f566d r984a9ba 63 63 } 64 64 65 static void mouse_connection( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)66 { 67 async_answer_0(icall _handle, EOK);65 static void mouse_connection(ipc_call_t *icall, void *arg) 66 { 67 async_answer_0(icall, EOK); 68 68 69 69 async_sess_t *sess = … … 79 79 while (true) { 80 80 ipc_call_t call; 81 cap_call_handle_t chandle =async_get_call(&call);81 async_get_call(&call); 82 82 83 83 if (!IPC_GET_IMETHOD(call)) 84 84 break; 85 85 86 async_answer_0( chandle, ENOTSUP);86 async_answer_0(&call, ENOTSUP); 87 87 } 88 88 } -
uspace/srv/hid/output/output.c
r76f566d r984a9ba 78 78 } 79 79 80 static void srv_yield( cap_call_handle_t icall_handle,ipc_call_t *icall)80 static void srv_yield(ipc_call_t *icall) 81 81 { 82 82 errno_t ret = EOK; … … 90 90 } 91 91 92 async_answer_0(icall _handle, ret);93 } 94 95 static void srv_claim( cap_call_handle_t icall_handle,ipc_call_t *icall)92 async_answer_0(icall, ret); 93 } 94 95 static void srv_claim(ipc_call_t *icall) 96 96 { 97 97 errno_t ret = EOK; … … 105 105 } 106 106 107 async_answer_0(icall _handle, ret);108 } 109 110 static void srv_get_dimensions( cap_call_handle_t icall_handle,ipc_call_t *icall)107 async_answer_0(icall, ret); 108 } 109 110 static void srv_get_dimensions(ipc_call_t *icall) 111 111 { 112 112 sysarg_t cols = MAX_COLS; … … 118 118 } 119 119 120 async_answer_2(icall _handle, EOK, cols, rows);121 } 122 123 static void srv_get_caps( cap_call_handle_t icall_handle,ipc_call_t *icall)120 async_answer_2(icall, EOK, cols, rows); 121 } 122 123 static void srv_get_caps(ipc_call_t *icall) 124 124 { 125 125 console_caps_t caps = 0; … … 131 131 } 132 132 133 async_answer_1(icall _handle, EOK, caps);134 } 135 136 static frontbuf_t *resolve_frontbuf(sysarg_t handle, cap_call_handle_t icall_handle)133 async_answer_1(icall, EOK, caps); 134 } 135 136 static frontbuf_t *resolve_frontbuf(sysarg_t handle, ipc_call_t *icall) 137 137 { 138 138 frontbuf_t *frontbuf = NULL; … … 145 145 146 146 if (frontbuf == NULL) { 147 async_answer_0(icall _handle, ENOENT);147 async_answer_0(icall, ENOENT); 148 148 return NULL; 149 149 } … … 152 152 } 153 153 154 static void srv_frontbuf_create( cap_call_handle_t icall_handle,ipc_call_t *icall)154 static void srv_frontbuf_create(ipc_call_t *icall) 155 155 { 156 156 frontbuf_t *frontbuf = (frontbuf_t *) malloc(sizeof(frontbuf_t)); 157 157 if (frontbuf == NULL) { 158 async_answer_0(icall _handle, ENOMEM);158 async_answer_0(icall, ENOMEM); 159 159 return; 160 160 } … … 162 162 link_initialize(&frontbuf->link); 163 163 164 cap_call_handle_t chandle;165 if (!async_share_out_receive(&c handle, &frontbuf->size,164 ipc_call_t call; 165 if (!async_share_out_receive(&call, &frontbuf->size, 166 166 &frontbuf->flags)) { 167 167 free(frontbuf); 168 async_answer_0(icall _handle, EINVAL);169 return; 170 } 171 172 errno_t rc = async_share_out_finalize( chandle, &frontbuf->data);168 async_answer_0(icall, EINVAL); 169 return; 170 } 171 172 errno_t rc = async_share_out_finalize(&call, &frontbuf->data); 173 173 if ((rc != EOK) || (frontbuf->data == AS_MAP_FAILED)) { 174 174 free(frontbuf); 175 async_answer_0(icall _handle, ENOMEM);175 async_answer_0(icall, ENOMEM); 176 176 return; 177 177 } 178 178 179 179 list_append(&frontbuf->link, &frontbufs); 180 async_answer_1(icall _handle, EOK, (sysarg_t) frontbuf);181 } 182 183 static void srv_frontbuf_destroy( cap_call_handle_t icall_handle,ipc_call_t *icall)184 { 185 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall _handle);180 async_answer_1(icall, EOK, (sysarg_t) frontbuf); 181 } 182 183 static void srv_frontbuf_destroy(ipc_call_t *icall) 184 { 185 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall); 186 186 if (frontbuf == NULL) 187 187 return; … … 191 191 free(frontbuf); 192 192 193 async_answer_0(icall _handle, EOK);194 } 195 196 static void srv_cursor_update( cap_call_handle_t icall_handle,ipc_call_t *icall)197 { 198 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall _handle);193 async_answer_0(icall, EOK); 194 } 195 196 static void srv_cursor_update(ipc_call_t *icall) 197 { 198 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall); 199 199 if (frontbuf == NULL) 200 200 return; … … 223 223 } 224 224 225 async_answer_0(icall _handle, EOK);226 } 227 228 static void srv_set_style( cap_call_handle_t icall_handle,ipc_call_t *icall)225 async_answer_0(icall, EOK); 226 } 227 228 static void srv_set_style(ipc_call_t *icall) 229 229 { 230 230 list_foreach(outdevs, link, outdev_t, dev) { … … 234 234 } 235 235 236 async_answer_0(icall _handle, EOK);237 } 238 239 static void srv_set_color( cap_call_handle_t icall_handle,ipc_call_t *icall)236 async_answer_0(icall, EOK); 237 } 238 239 static void srv_set_color(ipc_call_t *icall) 240 240 { 241 241 list_foreach(outdevs, link, outdev_t, dev) { … … 249 249 } 250 250 251 async_answer_0(icall _handle, EOK);252 } 253 254 static void srv_set_rgb_color( cap_call_handle_t icall_handle,ipc_call_t *icall)251 async_answer_0(icall, EOK); 252 } 253 254 static void srv_set_rgb_color(ipc_call_t *icall) 255 255 { 256 256 list_foreach(outdevs, link, outdev_t, dev) { … … 260 260 } 261 261 262 async_answer_0(icall _handle, EOK);262 async_answer_0(icall, EOK); 263 263 } 264 264 … … 302 302 } 303 303 304 static void srv_update( cap_call_handle_t icall_handle,ipc_call_t *icall)305 { 306 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall _handle);304 static void srv_update(ipc_call_t *icall) 305 { 306 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall); 307 307 if (frontbuf == NULL) 308 308 return; … … 348 348 } 349 349 350 351 async_answer_0(icall_handle, EOK); 352 } 353 354 static void srv_damage(cap_call_handle_t icall_handle, ipc_call_t *icall) 355 { 356 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall_handle); 350 async_answer_0(icall, EOK); 351 } 352 353 static void srv_damage(ipc_call_t *icall) 354 { 355 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), icall); 357 356 if (frontbuf == NULL) 358 357 return; … … 388 387 389 388 } 390 async_answer_0(icall_handle, EOK); 391 } 392 393 static void client_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg) 389 390 async_answer_0(icall, EOK); 391 } 392 393 static void client_connection(ipc_call_t *icall, void *arg) 394 394 { 395 395 /* Accept the connection */ 396 async_answer_0(icall _handle, EOK);396 async_answer_0(icall, EOK); 397 397 398 398 while (true) { 399 399 ipc_call_t call; 400 cap_call_handle_t chandle =async_get_call(&call);400 async_get_call(&call); 401 401 402 402 if (!IPC_GET_IMETHOD(call)) { 403 async_answer_0( chandle, EOK);403 async_answer_0(&call, EOK); 404 404 break; 405 405 } … … 407 407 switch (IPC_GET_IMETHOD(call)) { 408 408 case OUTPUT_YIELD: 409 srv_yield( chandle,&call);409 srv_yield(&call); 410 410 break; 411 411 case OUTPUT_CLAIM: 412 srv_claim( chandle,&call);412 srv_claim(&call); 413 413 break; 414 414 case OUTPUT_GET_DIMENSIONS: 415 srv_get_dimensions( chandle,&call);415 srv_get_dimensions(&call); 416 416 break; 417 417 case OUTPUT_GET_CAPS: 418 srv_get_caps( chandle,&call);418 srv_get_caps(&call); 419 419 break; 420 420 421 421 case OUTPUT_FRONTBUF_CREATE: 422 srv_frontbuf_create( chandle,&call);422 srv_frontbuf_create(&call); 423 423 break; 424 424 case OUTPUT_FRONTBUF_DESTROY: 425 srv_frontbuf_destroy( chandle,&call);425 srv_frontbuf_destroy(&call); 426 426 break; 427 427 428 428 case OUTPUT_CURSOR_UPDATE: 429 srv_cursor_update( chandle,&call);429 srv_cursor_update(&call); 430 430 break; 431 431 case OUTPUT_SET_STYLE: 432 srv_set_style( chandle,&call);432 srv_set_style(&call); 433 433 break; 434 434 case OUTPUT_SET_COLOR: 435 srv_set_color( chandle,&call);435 srv_set_color(&call); 436 436 break; 437 437 case OUTPUT_SET_RGB_COLOR: 438 srv_set_rgb_color( chandle,&call);438 srv_set_rgb_color(&call); 439 439 break; 440 440 case OUTPUT_UPDATE: 441 srv_update( chandle,&call);441 srv_update(&call); 442 442 break; 443 443 case OUTPUT_DAMAGE: 444 srv_damage( chandle,&call);444 srv_damage(&call); 445 445 break; 446 446 447 447 default: 448 async_answer_0( chandle, EINVAL);448 async_answer_0(&call, EINVAL); 449 449 } 450 450 } -
uspace/srv/hid/remcons/remcons.c
r76f566d r984a9ba 216 216 217 217 /** Callback when client connects to a telnet terminal. */ 218 static void client_connection( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)218 static void client_connection(ipc_call_t *icall, void *arg) 219 219 { 220 220 /* Find the user. */ 221 221 telnet_user_t *user = telnet_user_get_for_client_connection(IPC_GET_ARG2(*icall)); 222 222 if (user == NULL) { 223 async_answer_0(icall _handle, ENOENT);223 async_answer_0(icall, ENOENT); 224 224 return; 225 225 } 226 226 227 227 /* Handle messages. */ 228 con_conn(icall _handle, icall, &user->srvs);228 con_conn(icall, &user->srvs); 229 229 } 230 230 -
uspace/srv/hid/rfb/main.c
r76f566d r984a9ba 145 145 } 146 146 147 static void client_connection( cap_call_handle_t chandle,ipc_call_t *call, void *data)148 { 149 graph_visualizer_connection(vis, c handle, call, data);147 static void client_connection(ipc_call_t *call, void *data) 148 { 149 graph_visualizer_connection(vis, call, data); 150 150 } 151 151 -
uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
r76f566d r984a9ba 69 69 static s3c24xx_ts_t *ts; 70 70 71 static void s3c24xx_ts_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, 72 void *arg); 73 static void s3c24xx_ts_irq_handler(ipc_call_t *call, void *); 74 static void s3c24xx_ts_pen_down(s3c24xx_ts_t *ts); 75 static void s3c24xx_ts_pen_up(s3c24xx_ts_t *ts); 76 static void s3c24xx_ts_eoc(s3c24xx_ts_t *ts); 77 static int s3c24xx_ts_init(s3c24xx_ts_t *ts); 78 static void s3c24xx_ts_wait_for_int_mode(s3c24xx_ts_t *ts, ts_updn_t updn); 79 static void s3c24xx_ts_convert_samples(int smp0, int smp1, int *x, int *y); 80 static int lin_map_range(int v, int i0, int i1, int o0, int o1); 71 static void s3c24xx_ts_connection(ipc_call_t *, void *); 72 static void s3c24xx_ts_irq_handler(ipc_call_t *, void *); 73 static void s3c24xx_ts_pen_down(s3c24xx_ts_t *); 74 static void s3c24xx_ts_pen_up(s3c24xx_ts_t *); 75 static void s3c24xx_ts_eoc(s3c24xx_ts_t *); 76 static int s3c24xx_ts_init(s3c24xx_ts_t *); 77 static void s3c24xx_ts_wait_for_int_mode(s3c24xx_ts_t *, ts_updn_t); 78 static void s3c24xx_ts_convert_samples(int, int, int *, int *); 79 static int lin_map_range(int, int, int, int, int); 81 80 82 81 int main(int argc, char *argv[]) … … 371 370 372 371 /** Handle mouse client connection. */ 373 static void s3c24xx_ts_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, 374 void *arg) 375 { 376 async_answer_0(icall_handle, EOK); 372 static void s3c24xx_ts_connection(ipc_call_t *icall, void *arg) 373 { 374 async_answer_0(icall, EOK); 377 375 378 376 while (true) { 379 377 ipc_call_t call; 380 cap_call_handle_t chandle =async_get_call(&call);378 async_get_call(&call); 381 379 382 380 if (!IPC_GET_IMETHOD(call)) { … … 386 384 } 387 385 388 async_answer_0( chandle, EOK);386 async_answer_0(&call, EOK); 389 387 return; 390 388 } … … 395 393 if (ts->client_sess == NULL) { 396 394 ts->client_sess = sess; 397 async_answer_0( chandle, EOK);395 async_answer_0(&call, EOK); 398 396 } else 399 async_answer_0( chandle, ELIMIT);397 async_answer_0(&call, ELIMIT); 400 398 } else 401 async_answer_0( chandle, EINVAL);399 async_answer_0(&call, EINVAL); 402 400 } 403 401 }
Note:
See TracChangeset
for help on using the changeset viewer.