Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/console/console.c

    rffa2c8ef r3c22f70  
    3434
    3535#include <libc.h>
     36#include <ipc/ipc.h>
    3637#include <ipc/kbd.h>
    3738#include <io/keycode.h>
     
    3940#include <ipc/fb.h>
    4041#include <ipc/services.h>
    41 #include <ipc/ns.h>
    4242#include <errno.h>
    4343#include <ipc/console.h>
     
    116116static void curs_hide_sync(void)
    117117{
    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);
    119119}
    120120
     
    131131static void screen_yield(void)
    132132{
    133         async_req_0_0(fb_info.phone, FB_SCREEN_YIELD);
     133        ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD);
    134134}
    135135
    136136static void screen_reclaim(void)
    137137{
    138         async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
     138        ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
    139139}
    140140
    141141static void kbd_yield(void)
    142142{
    143         async_req_0_0(kbd_phone, KBD_YIELD);
     143        ipc_call_sync_0_0(kbd_phone, KBD_YIELD);
    144144}
    145145
    146146static void kbd_reclaim(void)
    147147{
    148         async_req_0_0(kbd_phone, KBD_RECLAIM);
     148        ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);
    149149}
    150150
     
    437437                        retval = ENOENT;
    438438                }
    439                 async_answer_0(callid, retval);
     439                ipc_answer_0(callid, retval);
    440440        }
    441441}
     
    472472                }
    473473
    474                 async_answer_0(callid, retval);
     474                ipc_answer_0(callid, retval);
    475475        }
    476476}
     
    483483       
    484484        if (rc != EOK) {
    485                 async_answer_0(rid, rc);
     485                ipc_answer_0(rid, rc);
    486486                return;
    487487        }
     
    498498       
    499499        gcons_notify_char(cons->index);
    500         async_answer_1(rid, EOK, size);
     500        ipc_answer_1(rid, EOK, size);
    501501       
    502502        free(buf);
     
    508508        size_t size;
    509509        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);
    512512                return;
    513513        }
     
    515515        char *buf = (char *) malloc(size);
    516516        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);
    519519                return;
    520520        }
     
    534534        if (pos == size) {
    535535                (void) async_data_read_finalize(callid, buf, size);
    536                 async_answer_1(rid, EOK, size);
     536                ipc_answer_1(rid, EOK, size);
    537537                free(buf);
    538538        } else {
     
    552552recheck:
    553553        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);
    555555        } else {
    556556                fibril_condvar_wait(&input_cv, &input_mutex);
     
    578578       
    579579        if (cons == NULL) {
    580                 async_answer_0(iid, ENOENT);
     580                ipc_answer_0(iid, ENOENT);
    581581                return;
    582582        }
     
    597597       
    598598        /* Accept the connection */
    599         async_answer_0(iid, EOK);
     599        ipc_answer_0(iid, EOK);
    600600       
    601601        while (true) {
     
    657657                        rc = ccap_fb_to_con(fb_info.color_cap, &arg1);
    658658                        if (rc != EOK) {
    659                                 async_answer_0(callid, rc);
     659                                ipc_answer_0(callid, rc);
    660660                                continue;
    661661                        }
     
    701701                        break;
    702702                }
    703                 async_answer_3(callid, EOK, arg1, arg2, arg3);
     703                ipc_answer_3(callid, EOK, arg1, arg2, arg3);
    704704        }
    705705}
     
    726726       
    727727        /* NB: The callback connection is slotted for removal */
    728         if (async_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, keyboard_events)
    729             != 0) {
     728        sysarg_t taskhash;
     729        sysarg_t phonehash;
     730        if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &taskhash,
     731            &phonehash) != 0) {
    730732                printf(NAME ": Failed to create callback from input device\n");
    731733                return false;
    732734        }
     735       
     736        async_new_connection(taskhash, phonehash, 0, NULL, keyboard_events);
    733737       
    734738        /* Connect to mouse device */
     
    747751        }
    748752       
    749         if (async_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, mouse_events)
    750             != 0) {
     753        if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &taskhash,
     754            &phonehash) != 0) {
    751755                printf(NAME ": Failed to create callback from mouse device\n");
    752756                mouse_phone = -1;
     
    754758        }
    755759       
     760        async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);
    756761skip_mouse:
    757762       
    758763        /* Connect to framebuffer driver */
    759         fb_info.phone = service_connect_blocking(SERVICE_VIDEO, 0, 0);
     764        fb_info.phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VIDEO, 0, 0);
    760765        if (fb_info.phone < 0) {
    761766                printf(NAME ": Failed to connect to video service\n");
     
    833838       
    834839        /* Receive kernel notifications */
    835         async_set_interrupt_received(interrupt_received);
    836840        if (event_subscribe(EVENT_KCONSOLE, 0) != EOK)
    837841                printf(NAME ": Error registering kconsole notifications\n");
     842       
     843        async_set_interrupt_received(interrupt_received);
    838844       
    839845        return true;
Note: See TracChangeset for help on using the changeset viewer.