Changeset e29e09cf in mainline for uspace/srv/hid/console/console.c


Ignore:
Timestamp:
2011-02-04T21:00:56Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
474afc9, 960ff451
Parents:
400575c5 (diff), 17aca1c (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.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r400575c5 re29e09cf  
    3434
    3535#include <libc.h>
    36 #include <ipc/ipc.h>
    3736#include <ipc/kbd.h>
    3837#include <io/keycode.h>
     
    4039#include <ipc/fb.h>
    4140#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         ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false);
     118        async_req_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false);
    119119}
    120120
     
    131131static void screen_yield(void)
    132132{
    133         ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD);
     133        async_req_0_0(fb_info.phone, FB_SCREEN_YIELD);
    134134}
    135135
    136136static void screen_reclaim(void)
    137137{
    138         ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
     138        async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
    139139}
    140140
    141141static void kbd_yield(void)
    142142{
    143         ipc_call_sync_0_0(kbd_phone, KBD_YIELD);
     143        async_req_0_0(kbd_phone, KBD_YIELD);
    144144}
    145145
    146146static void kbd_reclaim(void)
    147147{
    148         ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);
     148        async_req_0_0(kbd_phone, KBD_RECLAIM);
    149149}
    150150
     
    438438                        retval = ENOENT;
    439439                }
    440                 ipc_answer_0(callid, retval);
     440                async_answer_0(callid, retval);
    441441        }
    442442}
     
    474474                }
    475475
    476                 ipc_answer_0(callid, retval);
     476                async_answer_0(callid, retval);
    477477        }
    478478}
     
    485485       
    486486        if (rc != EOK) {
    487                 ipc_answer_0(rid, rc);
     487                async_answer_0(rid, rc);
    488488                return;
    489489        }
     
    500500       
    501501        gcons_notify_char(cons->index);
    502         ipc_answer_1(rid, EOK, size);
     502        async_answer_1(rid, EOK, size);
    503503       
    504504        free(buf);
     
    510510        size_t size;
    511511        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);
    514514                return;
    515515        }
     
    517517        char *buf = (char *) malloc(size);
    518518        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);
    521521                return;
    522522        }
     
    536536        if (pos == size) {
    537537                (void) async_data_read_finalize(callid, buf, size);
    538                 ipc_answer_1(rid, EOK, size);
     538                async_answer_1(rid, EOK, size);
    539539                free(buf);
    540540        } else {
     
    554554recheck:
    555555        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);
    557557        } else {
    558558                fibril_condvar_wait(&input_cv, &input_mutex);
     
    580580       
    581581        if (cons == NULL) {
    582                 ipc_answer_0(iid, ENOENT);
     582                async_answer_0(iid, ENOENT);
    583583                return;
    584584        }
     
    599599       
    600600        /* Accept the connection */
    601         ipc_answer_0(iid, EOK);
     601        async_answer_0(iid, EOK);
    602602       
    603603        while (true) {
     
    659659                        rc = ccap_fb_to_con(fb_info.color_cap, &arg1);
    660660                        if (rc != EOK) {
    661                                 ipc_answer_0(callid, rc);
     661                                async_answer_0(callid, rc);
    662662                                continue;
    663663                        }
     
    703703                        break;
    704704                }
    705                 ipc_answer_3(callid, EOK, arg1, arg2, arg3);
     705                async_answer_3(callid, EOK, arg1, arg2, arg3);
    706706        }
    707707}
     
    762762        if (retval != EOK) {
    763763                async_wait_for(req, NULL);
    764                 ipc_hangup(devmap_phone);
     764                async_hangup(devmap_phone);
    765765                return retval;
    766766        }
     
    769769
    770770        if (retval != EOK) {
    771                 ipc_hangup(devmap_phone);
     771                async_hangup(devmap_phone);
    772772                return retval;
    773773        }
     
    775775        devmap_handle_t handle = (devmap_handle_t) IPC_GET_ARG1(answer);
    776776
    777         ipc_hangup(devmap_phone);
     777        async_hangup(devmap_phone);
    778778
    779779        int phone = async_connect_me_to(PHONE_NS,
     
    864864        }
    865865       
    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) {
    870868                printf(NAME ": Failed to create callback from mouse device\n");
    871869                mouse_phone = -1;
     
    873871        }
    874872       
    875         async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);
    876873skip_mouse:
    877874       
    878875        /* 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);
    880877        if (fb_info.phone < 0) {
    881878                printf(NAME ": Failed to connect to video service\n");
     
    953950       
    954951        /* Receive kernel notifications */
     952        async_set_interrupt_received(interrupt_received);
    955953        if (event_subscribe(EVENT_KCONSOLE, 0) != EOK)
    956954                printf(NAME ": Error registering kconsole notifications\n");
    957        
    958         async_set_interrupt_received(interrupt_received);
    959955       
    960956        /* Start fibril for checking on hot-plugged keyboards. */
Note: See TracChangeset for help on using the changeset viewer.