Changeset 984a9ba in mainline for uspace/srv/hid/output/output.c
- Timestamp:
- 2018-07-05T09:34:09Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63d46341
- Parents:
- 76f566d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.