Ignore:
File:
1 edited

Legend:

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

    rffa2c8ef r007e6efa  
    3434
    3535#include <libc.h>
     36#include <ipc/ipc.h>
    3637#include <ipc/kbd.h>
    3738#include <io/keycode.h>
     
    116117static void curs_hide_sync(void)
    117118{
    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);
    119120}
    120121
     
    131132static void screen_yield(void)
    132133{
    133         async_req_0_0(fb_info.phone, FB_SCREEN_YIELD);
     134        ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD);
    134135}
    135136
    136137static void screen_reclaim(void)
    137138{
    138         async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
     139        ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
    139140}
    140141
    141142static void kbd_yield(void)
    142143{
    143         async_req_0_0(kbd_phone, KBD_YIELD);
     144        ipc_call_sync_0_0(kbd_phone, KBD_YIELD);
    144145}
    145146
    146147static void kbd_reclaim(void)
    147148{
    148         async_req_0_0(kbd_phone, KBD_RECLAIM);
     149        ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);
    149150}
    150151
     
    437438                        retval = ENOENT;
    438439                }
    439                 async_answer_0(callid, retval);
     440                ipc_answer_0(callid, retval);
    440441        }
    441442}
     
    472473                }
    473474
    474                 async_answer_0(callid, retval);
     475                ipc_answer_0(callid, retval);
    475476        }
    476477}
     
    483484       
    484485        if (rc != EOK) {
    485                 async_answer_0(rid, rc);
     486                ipc_answer_0(rid, rc);
    486487                return;
    487488        }
     
    498499       
    499500        gcons_notify_char(cons->index);
    500         async_answer_1(rid, EOK, size);
     501        ipc_answer_1(rid, EOK, size);
    501502       
    502503        free(buf);
     
    508509        size_t size;
    509510        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);
    512513                return;
    513514        }
     
    515516        char *buf = (char *) malloc(size);
    516517        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);
    519520                return;
    520521        }
     
    534535        if (pos == size) {
    535536                (void) async_data_read_finalize(callid, buf, size);
    536                 async_answer_1(rid, EOK, size);
     537                ipc_answer_1(rid, EOK, size);
    537538                free(buf);
    538539        } else {
     
    552553recheck:
    553554        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);
    555556        } else {
    556557                fibril_condvar_wait(&input_cv, &input_mutex);
     
    578579       
    579580        if (cons == NULL) {
    580                 async_answer_0(iid, ENOENT);
     581                ipc_answer_0(iid, ENOENT);
    581582                return;
    582583        }
     
    597598       
    598599        /* Accept the connection */
    599         async_answer_0(iid, EOK);
     600        ipc_answer_0(iid, EOK);
    600601       
    601602        while (true) {
     
    657658                        rc = ccap_fb_to_con(fb_info.color_cap, &arg1);
    658659                        if (rc != EOK) {
    659                                 async_answer_0(callid, rc);
     660                                ipc_answer_0(callid, rc);
    660661                                continue;
    661662                        }
     
    701702                        break;
    702703                }
    703                 async_answer_3(callid, EOK, arg1, arg2, arg3);
     704                ipc_answer_3(callid, EOK, arg1, arg2, arg3);
    704705        }
    705706}
     
    726727       
    727728        /* 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) {
    730733                printf(NAME ": Failed to create callback from input device\n");
    731734                return false;
    732735        }
     736       
     737        async_new_connection(taskhash, phonehash, 0, NULL, keyboard_events);
    733738       
    734739        /* Connect to mouse device */
     
    747752        }
    748753       
    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) {
    751756                printf(NAME ": Failed to create callback from mouse device\n");
    752757                mouse_phone = -1;
     
    754759        }
    755760       
     761        async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);
    756762skip_mouse:
    757763       
Note: See TracChangeset for help on using the changeset viewer.