Changeset 17aca1c in mainline for uspace/srv/hid/console/console.c
- Timestamp:
- 2011-02-04T20:56:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0397e5a4, e29e09cf
- Parents:
- e778543 (diff), 0b37882 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
re778543 r17aca1c 34 34 35 35 #include <libc.h> 36 #include <ipc/ipc.h>37 36 #include <ipc/kbd.h> 38 37 #include <io/keycode.h> … … 40 39 #include <ipc/fb.h> 41 40 #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 ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false);118 async_req_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); 119 119 } 120 120 … … 131 131 static void screen_yield(void) 132 132 { 133 ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD);133 async_req_0_0(fb_info.phone, FB_SCREEN_YIELD); 134 134 } 135 135 136 136 static void screen_reclaim(void) 137 137 { 138 ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);138 async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM); 139 139 } 140 140 141 141 static void kbd_yield(void) 142 142 { 143 ipc_call_sync_0_0(kbd_phone, KBD_YIELD);143 async_req_0_0(kbd_phone, KBD_YIELD); 144 144 } 145 145 146 146 static void kbd_reclaim(void) 147 147 { 148 ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);148 async_req_0_0(kbd_phone, KBD_RECLAIM); 149 149 } 150 150 … … 438 438 retval = ENOENT; 439 439 } 440 ipc_answer_0(callid, retval);440 async_answer_0(callid, retval); 441 441 } 442 442 } … … 474 474 } 475 475 476 ipc_answer_0(callid, retval);476 async_answer_0(callid, retval); 477 477 } 478 478 } … … 485 485 486 486 if (rc != EOK) { 487 ipc_answer_0(rid, rc);487 async_answer_0(rid, rc); 488 488 return; 489 489 } … … 500 500 501 501 gcons_notify_char(cons->index); 502 ipc_answer_1(rid, EOK, size);502 async_answer_1(rid, EOK, size); 503 503 504 504 free(buf); … … 510 510 size_t size; 511 511 if (!async_data_read_receive(&callid, &size)) { 512 ipc_answer_0(callid, EINVAL);513 ipc_answer_0(rid, EINVAL);512 async_answer_0(callid, EINVAL); 513 async_answer_0(rid, EINVAL); 514 514 return; 515 515 } … … 517 517 char *buf = (char *) malloc(size); 518 518 if (buf == NULL) { 519 ipc_answer_0(callid, ENOMEM);520 ipc_answer_0(rid, ENOMEM);519 async_answer_0(callid, ENOMEM); 520 async_answer_0(rid, ENOMEM); 521 521 return; 522 522 } … … 536 536 if (pos == size) { 537 537 (void) async_data_read_finalize(callid, buf, size); 538 ipc_answer_1(rid, EOK, size);538 async_answer_1(rid, EOK, size); 539 539 free(buf); 540 540 } else { … … 554 554 recheck: 555 555 if (keybuffer_pop(&cons->keybuffer, &ev)) { 556 ipc_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c);556 async_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c); 557 557 } else { 558 558 fibril_condvar_wait(&input_cv, &input_mutex); … … 580 580 581 581 if (cons == NULL) { 582 ipc_answer_0(iid, ENOENT);582 async_answer_0(iid, ENOENT); 583 583 return; 584 584 } … … 599 599 600 600 /* Accept the connection */ 601 ipc_answer_0(iid, EOK);601 async_answer_0(iid, EOK); 602 602 603 603 while (true) { … … 659 659 rc = ccap_fb_to_con(fb_info.color_cap, &arg1); 660 660 if (rc != EOK) { 661 ipc_answer_0(callid, rc);661 async_answer_0(callid, rc); 662 662 continue; 663 663 } … … 703 703 break; 704 704 } 705 ipc_answer_3(callid, EOK, arg1, arg2, arg3);705 async_answer_3(callid, EOK, arg1, arg2, arg3); 706 706 } 707 707 } … … 762 762 if (retval != EOK) { 763 763 async_wait_for(req, NULL); 764 ipc_hangup(devmap_phone);764 async_hangup(devmap_phone); 765 765 return retval; 766 766 } … … 769 769 770 770 if (retval != EOK) { 771 ipc_hangup(devmap_phone);771 async_hangup(devmap_phone); 772 772 return retval; 773 773 } … … 775 775 devmap_handle_t handle = (devmap_handle_t) IPC_GET_ARG1(answer); 776 776 777 ipc_hangup(devmap_phone);777 async_hangup(devmap_phone); 778 778 779 779 int phone = async_connect_me_to(PHONE_NS, … … 864 864 } 865 865 866 sysarg_t taskhash; 867 sysarg_t phonehash; 868 if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &taskhash, 869 &phonehash) != 0) { 866 if (async_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, mouse_events) 867 != 0) { 870 868 printf(NAME ": Failed to create callback from mouse device\n"); 871 869 mouse_phone = -1; … … 873 871 } 874 872 875 async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);876 873 skip_mouse: 877 874 878 875 /* Connect to framebuffer driver */ 879 fb_info.phone = ipc_connect_me_to_blocking(PHONE_NS,SERVICE_VIDEO, 0, 0);876 fb_info.phone = service_connect_blocking(SERVICE_VIDEO, 0, 0); 880 877 if (fb_info.phone < 0) { 881 878 printf(NAME ": Failed to connect to video service\n"); … … 953 950 954 951 /* Receive kernel notifications */ 952 async_set_interrupt_received(interrupt_received); 955 953 if (event_subscribe(EVENT_KCONSOLE, 0) != EOK) 956 954 printf(NAME ": Error registering kconsole notifications\n"); 957 958 async_set_interrupt_received(interrupt_received);959 955 960 956 /* Start fibril for checking on hot-plugged keyboards. */
Note:
See TracChangeset
for help on using the changeset viewer.