Changes in uspace/srv/hid/console/console.c [ffa2c8ef:007e6efa] in mainline
- File:
-
- 1 edited
-
uspace/srv/hid/console/console.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
rffa2c8ef r007e6efa 34 34 35 35 #include <libc.h> 36 #include <ipc/ipc.h> 36 37 #include <ipc/kbd.h> 37 38 #include <io/keycode.h> … … 116 117 static void curs_hide_sync(void) 117 118 { 118 async_req_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false);119 ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); 119 120 } 120 121 … … 131 132 static void screen_yield(void) 132 133 { 133 async_req_0_0(fb_info.phone, FB_SCREEN_YIELD);134 ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD); 134 135 } 135 136 136 137 static void screen_reclaim(void) 137 138 { 138 async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM);139 ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM); 139 140 } 140 141 141 142 static void kbd_yield(void) 142 143 { 143 async_req_0_0(kbd_phone, KBD_YIELD);144 ipc_call_sync_0_0(kbd_phone, KBD_YIELD); 144 145 } 145 146 146 147 static void kbd_reclaim(void) 147 148 { 148 async_req_0_0(kbd_phone, KBD_RECLAIM);149 ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM); 149 150 } 150 151 … … 437 438 retval = ENOENT; 438 439 } 439 async_answer_0(callid, retval);440 ipc_answer_0(callid, retval); 440 441 } 441 442 } … … 472 473 } 473 474 474 async_answer_0(callid, retval);475 ipc_answer_0(callid, retval); 475 476 } 476 477 } … … 483 484 484 485 if (rc != EOK) { 485 async_answer_0(rid, rc);486 ipc_answer_0(rid, rc); 486 487 return; 487 488 } … … 498 499 499 500 gcons_notify_char(cons->index); 500 async_answer_1(rid, EOK, size);501 ipc_answer_1(rid, EOK, size); 501 502 502 503 free(buf); … … 508 509 size_t size; 509 510 if (!async_data_read_receive(&callid, &size)) { 510 async_answer_0(callid, EINVAL);511 async_answer_0(rid, EINVAL);511 ipc_answer_0(callid, EINVAL); 512 ipc_answer_0(rid, EINVAL); 512 513 return; 513 514 } … … 515 516 char *buf = (char *) malloc(size); 516 517 if (buf == NULL) { 517 async_answer_0(callid, ENOMEM);518 async_answer_0(rid, ENOMEM);518 ipc_answer_0(callid, ENOMEM); 519 ipc_answer_0(rid, ENOMEM); 519 520 return; 520 521 } … … 534 535 if (pos == size) { 535 536 (void) async_data_read_finalize(callid, buf, size); 536 async_answer_1(rid, EOK, size);537 ipc_answer_1(rid, EOK, size); 537 538 free(buf); 538 539 } else { … … 552 553 recheck: 553 554 if (keybuffer_pop(&cons->keybuffer, &ev)) { 554 async_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c);555 ipc_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c); 555 556 } else { 556 557 fibril_condvar_wait(&input_cv, &input_mutex); … … 578 579 579 580 if (cons == NULL) { 580 async_answer_0(iid, ENOENT);581 ipc_answer_0(iid, ENOENT); 581 582 return; 582 583 } … … 597 598 598 599 /* Accept the connection */ 599 async_answer_0(iid, EOK);600 ipc_answer_0(iid, EOK); 600 601 601 602 while (true) { … … 657 658 rc = ccap_fb_to_con(fb_info.color_cap, &arg1); 658 659 if (rc != EOK) { 659 async_answer_0(callid, rc);660 ipc_answer_0(callid, rc); 660 661 continue; 661 662 } … … 701 702 break; 702 703 } 703 async_answer_3(callid, EOK, arg1, arg2, arg3);704 ipc_answer_3(callid, EOK, arg1, arg2, arg3); 704 705 } 705 706 } … … 726 727 727 728 /* NB: The callback connection is slotted for removal */ 728 if (async_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, keyboard_events) 729 != 0) { 729 sysarg_t taskhash; 730 sysarg_t phonehash; 731 if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &taskhash, 732 &phonehash) != 0) { 730 733 printf(NAME ": Failed to create callback from input device\n"); 731 734 return false; 732 735 } 736 737 async_new_connection(taskhash, phonehash, 0, NULL, keyboard_events); 733 738 734 739 /* Connect to mouse device */ … … 747 752 } 748 753 749 if ( async_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, mouse_events)750 != 0) {754 if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &taskhash, 755 &phonehash) != 0) { 751 756 printf(NAME ": Failed to create callback from mouse device\n"); 752 757 mouse_phone = -1; … … 754 759 } 755 760 761 async_new_connection(taskhash, phonehash, 0, NULL, mouse_events); 756 762 skip_mouse: 757 763
Note:
See TracChangeset
for help on using the changeset viewer.
