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