Changeset a46e56b in mainline for uspace/srv/hid/output/output.c
- Timestamp:
- 2018-03-22T06:49:35Z (6 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/output/output.c
r3e242d2 ra46e56b 78 78 } 79 79 80 static void srv_yield(cap_call_handle_t i id, ipc_call_t *icall)80 static void srv_yield(cap_call_handle_t icall_handle, ipc_call_t *icall) 81 81 { 82 82 errno_t ret = EOK; … … 90 90 } 91 91 92 async_answer_0(i id, ret);93 } 94 95 static void srv_claim(cap_call_handle_t i id, ipc_call_t *icall)92 async_answer_0(icall_handle, ret); 93 } 94 95 static void srv_claim(cap_call_handle_t icall_handle, ipc_call_t *icall) 96 96 { 97 97 errno_t ret = EOK; … … 105 105 } 106 106 107 async_answer_0(i id, ret);108 } 109 110 static void srv_get_dimensions(cap_call_handle_t i id, ipc_call_t *icall)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) 111 111 { 112 112 sysarg_t cols = MAX_COLS; … … 118 118 } 119 119 120 async_answer_2(i id, EOK, cols, rows);121 } 122 123 static void srv_get_caps(cap_call_handle_t i id, ipc_call_t *icall)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) 124 124 { 125 125 console_caps_t caps = 0; … … 131 131 } 132 132 133 async_answer_1(i id, EOK, caps);134 } 135 136 static frontbuf_t *resolve_frontbuf(sysarg_t handle, cap_call_handle_t i id)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) 137 137 { 138 138 frontbuf_t *frontbuf = NULL; … … 145 145 146 146 if (frontbuf == NULL) { 147 async_answer_0(i id, ENOENT);147 async_answer_0(icall_handle, ENOENT); 148 148 return NULL; 149 149 } … … 152 152 } 153 153 154 static void srv_frontbuf_create(cap_call_handle_t i id, ipc_call_t *icall)154 static void srv_frontbuf_create(cap_call_handle_t icall_handle, 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(i id, ENOMEM);158 async_answer_0(icall_handle, ENOMEM); 159 159 return; 160 160 } … … 162 162 link_initialize(&frontbuf->link); 163 163 164 cap_call_handle_t c allid;165 if (!async_share_out_receive(&c allid, &frontbuf->size,164 cap_call_handle_t chandle; 165 if (!async_share_out_receive(&chandle, &frontbuf->size, 166 166 &frontbuf->flags)) { 167 167 free(frontbuf); 168 async_answer_0(i id, EINVAL);169 return; 170 } 171 172 errno_t rc = async_share_out_finalize(c allid, &frontbuf->data);168 async_answer_0(icall_handle, EINVAL); 169 return; 170 } 171 172 errno_t rc = async_share_out_finalize(chandle, &frontbuf->data); 173 173 if ((rc != EOK) || (frontbuf->data == AS_MAP_FAILED)) { 174 174 free(frontbuf); 175 async_answer_0(i id, ENOMEM);175 async_answer_0(icall_handle, ENOMEM); 176 176 return; 177 177 } 178 178 179 179 list_append(&frontbuf->link, &frontbufs); 180 async_answer_1(i id, EOK, (sysarg_t) frontbuf);181 } 182 183 static void srv_frontbuf_destroy(cap_call_handle_t i id, ipc_call_t *icall)184 { 185 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), i id);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); 186 186 if (frontbuf == NULL) 187 187 return; … … 191 191 free(frontbuf); 192 192 193 async_answer_0(i id, EOK);194 } 195 196 static void srv_cursor_update(cap_call_handle_t i id, ipc_call_t *icall)197 { 198 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), i id);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); 199 199 if (frontbuf == NULL) 200 200 return; … … 223 223 } 224 224 225 async_answer_0(i id, EOK);226 } 227 228 static void srv_set_style(cap_call_handle_t i id, ipc_call_t *icall)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) 229 229 { 230 230 list_foreach(outdevs, link, outdev_t, dev) { … … 234 234 } 235 235 236 async_answer_0(i id, EOK);237 } 238 239 static void srv_set_color(cap_call_handle_t i id, ipc_call_t *icall)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) 240 240 { 241 241 list_foreach(outdevs, link, outdev_t, dev) { … … 249 249 } 250 250 251 async_answer_0(i id, EOK);252 } 253 254 static void srv_set_rgb_color(cap_call_handle_t i id, ipc_call_t *icall)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) 255 255 { 256 256 list_foreach(outdevs, link, outdev_t, dev) { … … 260 260 } 261 261 262 async_answer_0(i id, EOK);262 async_answer_0(icall_handle, EOK); 263 263 } 264 264 … … 302 302 } 303 303 304 static void srv_update(cap_call_handle_t i id, ipc_call_t *icall)305 { 306 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), i id);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); 307 307 if (frontbuf == NULL) 308 308 return; … … 349 349 350 350 351 async_answer_0(i id, EOK);352 } 353 354 static void srv_damage(cap_call_handle_t i id, ipc_call_t *icall)355 { 356 frontbuf_t *frontbuf = resolve_frontbuf(IPC_GET_ARG1(*icall), i id);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); 357 357 if (frontbuf == NULL) 358 358 return; … … 388 388 389 389 } 390 async_answer_0(i id, EOK);391 } 392 393 static void client_connection(cap_call_handle_t i id, ipc_call_t *icall, void *arg)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) 394 394 { 395 395 /* Accept the connection */ 396 async_answer_0(i id, EOK);396 async_answer_0(icall_handle, EOK); 397 397 398 398 while (true) { 399 399 ipc_call_t call; 400 cap_call_handle_t c allid= async_get_call(&call);400 cap_call_handle_t chandle = async_get_call(&call); 401 401 402 402 if (!IPC_GET_IMETHOD(call)) { 403 async_answer_0(c allid, EOK);403 async_answer_0(chandle, EOK); 404 404 break; 405 405 } … … 407 407 switch (IPC_GET_IMETHOD(call)) { 408 408 case OUTPUT_YIELD: 409 srv_yield(c allid, &call);409 srv_yield(chandle, &call); 410 410 break; 411 411 case OUTPUT_CLAIM: 412 srv_claim(c allid, &call);412 srv_claim(chandle, &call); 413 413 break; 414 414 case OUTPUT_GET_DIMENSIONS: 415 srv_get_dimensions(c allid, &call);415 srv_get_dimensions(chandle, &call); 416 416 break; 417 417 case OUTPUT_GET_CAPS: 418 srv_get_caps(c allid, &call);418 srv_get_caps(chandle, &call); 419 419 break; 420 420 421 421 case OUTPUT_FRONTBUF_CREATE: 422 srv_frontbuf_create(c allid, &call);422 srv_frontbuf_create(chandle, &call); 423 423 break; 424 424 case OUTPUT_FRONTBUF_DESTROY: 425 srv_frontbuf_destroy(c allid, &call);425 srv_frontbuf_destroy(chandle, &call); 426 426 break; 427 427 428 428 case OUTPUT_CURSOR_UPDATE: 429 srv_cursor_update(c allid, &call);429 srv_cursor_update(chandle, &call); 430 430 break; 431 431 case OUTPUT_SET_STYLE: 432 srv_set_style(c allid, &call);432 srv_set_style(chandle, &call); 433 433 break; 434 434 case OUTPUT_SET_COLOR: 435 srv_set_color(c allid, &call);435 srv_set_color(chandle, &call); 436 436 break; 437 437 case OUTPUT_SET_RGB_COLOR: 438 srv_set_rgb_color(c allid, &call);438 srv_set_rgb_color(chandle, &call); 439 439 break; 440 440 case OUTPUT_UPDATE: 441 srv_update(c allid, &call);441 srv_update(chandle, &call); 442 442 break; 443 443 case OUTPUT_DAMAGE: 444 srv_damage(c allid, &call);444 srv_damage(chandle, &call); 445 445 break; 446 446 447 447 default: 448 async_answer_0(c allid, EINVAL);448 async_answer_0(chandle, EINVAL); 449 449 } 450 450 }
Note:
See TracChangeset
for help on using the changeset viewer.