Changeset 0cc4313 in mainline for uspace/srv


Ignore:
Timestamp:
2007-11-22T15:50:24Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d40a8ff
Parents:
8498915
Message:

Modify the async framework to make use of all six syscall arguments.
Supply user-friendly macros as in previous cases.

Location:
uspace/srv
Files:
4 edited

Legend:

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

    r8498915 r0cc4313  
    106106static void clrscr(void)
    107107{
    108         async_msg(fb_info.phone, FB_CLEAR, 0);
     108        async_msg_0(fb_info.phone, FB_CLEAR);
    109109}
    110110
    111111static void curs_visibility(int v)
    112112{
    113         async_msg(fb_info.phone, FB_CURSOR_VISIBILITY, v);
     113        async_msg_1(fb_info.phone, FB_CURSOR_VISIBILITY, v);
    114114}
    115115
     
    177177                scr->top_line = (scr->top_line + 1) % scr->size_y;
    178178                if (console == active_console)
    179                         async_msg(fb_info.phone, FB_SCROLL, 1);
     179                        async_msg_1(fb_info.phone, FB_SCROLL, 1);
    180180        }
    181181       
     
    197197       
    198198        /* Save screen */
    199         newpmap = async_req(fb_info.phone, FB_VP2PIXMAP, 0, NULL);
     199        newpmap = async_req_0_0(fb_info.phone, FB_VP2PIXMAP);
    200200        if (newpmap < 0)
    201201                return -1;
     
    205205                async_msg_2(fb_info.phone, FB_VP_DRAW_PIXMAP, 0, oldpixmap);
    206206                /* Drop old pixmap */
    207                 async_msg(fb_info.phone, FB_DROP_PIXMAP, oldpixmap);
     207                async_msg_1(fb_info.phone, FB_DROP_PIXMAP, oldpixmap);
    208208        }
    209209       
     
    267267                        }
    268268                /* This call can preempt, but we are already at the end */
    269                 rc = async_req_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL,
    270                     NULL);             
     269                rc = async_req_0_0(fb_info.phone, FB_DRAW_TEXT_DATA);           
    271270        }
    272271       
     
    416415                        /* Send message to fb */
    417416                        if (consnum == active_console) {
    418                                 async_msg(fb_info.phone, FB_CLEAR, 0);
     417                                async_msg_0(fb_info.phone, FB_CLEAR);
    419418                        }
    420419                       
     
    435434                case CONSOLE_FLUSH:
    436435                        if (consnum == active_console)
    437                                 async_req_2(fb_info.phone, FB_FLUSH, 0, 0,
    438                                     NULL, NULL);               
     436                                async_req_0_0(fb_info.phone, FB_FLUSH);
    439437                        break;
    440438                case CONSOLE_SET_STYLE:
     
    509507        gcons_init(fb_info.phone);
    510508        /* Synchronize, the gcons can have something in queue */
    511         async_req(fb_info.phone, FB_FLUSH, 0, NULL);
     509        async_req_0_0(fb_info.phone, FB_FLUSH);
    512510        /* Enable double buffering */
    513511        async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1);
    514512       
    515         async_req_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &fb_info.rows,
     513        async_req_0_2(fb_info.phone, FB_GET_CSIZE, &fb_info.rows,
    516514            &fb_info.cols);
    517515        set_style_col(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND);
     
    540538            PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
    541539        if (!interbuffer) {
    542                 if (async_req_3(fb_info.phone, IPC_M_AS_AREA_SEND,
    543                     (ipcarg_t) interbuffer, 0, AS_AREA_READ, NULL, NULL,
    544                     NULL) != 0) {
     540                if (async_req_3_0(fb_info.phone, IPC_M_AS_AREA_SEND,
     541                    (ipcarg_t) interbuffer, 0, AS_AREA_READ) != 0) {
    545542                        munmap(interbuffer,
    546543                            sizeof(keyfield_t) * fb_info.cols * fb_info.rows);
  • uspace/srv/console/gcons.c

    r8498915 r0cc4313  
    8282static void vp_switch(int vp)
    8383{
    84         async_msg(fbphone,FB_VIEWPORT_SWITCH, vp);
     84        async_msg_1(fbphone,FB_VIEWPORT_SWITCH, vp);
    8585}
    8686
    8787/** Create view port */
    88 static int vp_create(unsigned int x, unsigned int y,
    89                      unsigned int width, unsigned int height)
    90 {
    91         return async_req_2(fbphone, FB_VIEWPORT_CREATE,
    92                            (x << 16) | y, (width << 16) | height, NULL, NULL);
     88static int vp_create(unsigned int x, unsigned int y, unsigned int width,
     89    unsigned int height)
     90{
     91        return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y,
     92            (width << 16) | height);
    9393}
    9494
    9595static void clear(void)
    9696{
    97         async_msg(fbphone, FB_CLEAR, 0);
     97        async_msg_0(fbphone, FB_CLEAR);
    9898}
    9999
     
    119119        if (ic_pixmaps[state] != -1)
    120120                async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum],
    121                         ic_pixmaps[state]);
     121                    ic_pixmaps[state]);
    122122
    123123        if (state != CONS_DISCONNECTED && state != CONS_KERNEL &&
     
    141141                        redraw_state(i);
    142142                if (animation != -1)
    143                         async_msg(fbphone, FB_ANIM_START, animation);
     143                        async_msg_1(fbphone, FB_ANIM_START, animation);
    144144        } else {
    145145                if (console_state[active_console] == CONS_DISCONNECTED_SEL)
     
    225225
    226226        if (animation != -1)
    227                 async_msg(fbphone, FB_ANIM_STOP, animation);
     227                async_msg_1(fbphone, FB_ANIM_STOP, animation);
    228228
    229229        active_console = KERNEL_CONSOLE; /* Set to kernel console */
     
    317317        /* Create area */
    318318        shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
    319                 MAP_ANONYMOUS, 0, 0);
     319            MAP_ANONYMOUS, 0, 0);
    320320        if (shm == MAP_FAILED)
    321321                return;
     
    323323        memcpy(shm, logo, size);
    324324        /* Send area */
    325         rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm, 0, NULL,
    326                 NULL);
     325        rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
    327326        if (rc)
    328327                goto exit;
    329         rc = async_req_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0,
    330                 PROTO_READ, NULL, NULL, NULL);
     328        rc = async_req_3_0(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0,
     329            PROTO_READ);
    331330        if (rc)
    332331                goto drop;
     
    335334drop:
    336335        /* Drop area */
    337         async_msg(fbphone, FB_DROP_SHM, 0);
     336        async_msg_0(fbphone, FB_DROP_SHM);
    338337exit:       
    339338        /* Remove area */
     
    357356        clear();
    358357        draw_pixmap(_binary_helenos_ppm_start,
    359                 (size_t) &_binary_helenos_ppm_size, xres - 66, 2);
     358            (size_t) &_binary_helenos_ppm_size, xres - 66, 2);
    360359        draw_pixmap(_binary_nameic_ppm_start,
    361                 (size_t) &_binary_nameic_ppm_size, 5, 17);
    362 
    363         for (i = 0;i < CONSOLE_COUNT; i++)
     360            (size_t) &_binary_nameic_ppm_size, 5, 17);
     361
     362        for (i = 0; i < CONSOLE_COUNT; i++)
    364363                redraw_state(i);
    365364        vp_switch(console_vp);
     
    380379        /* Create area */
    381380        shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
    382                 MAP_ANONYMOUS, 0, 0);
     381            MAP_ANONYMOUS, 0, 0);
    383382        if (shm == MAP_FAILED)
    384383                return -1;
     
    386385        memcpy(shm, data, size);
    387386        /* Send area */
    388         rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm, 0, NULL,
    389                 NULL);
     387        rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm);
    390388        if (rc)
    391389                goto exit;
    392         rc = async_req_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0,
    393                 PROTO_READ, NULL, NULL, NULL);
     390        rc = async_req_3_0(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0,
     391            PROTO_READ);
    394392        if (rc)
    395393                goto drop;
    396394
    397395        /* Obtain pixmap */
    398         rc = async_req(fbphone, FB_SHM2PIXMAP, 0, NULL);
     396        rc = async_req_0_0(fbphone, FB_SHM2PIXMAP);
    399397        if (rc < 0)
    400398                goto drop;
     
    402400drop:
    403401        /* Drop area */
    404         async_msg(fbphone, FB_DROP_SHM, 0);
     402        async_msg_0(fbphone, FB_DROP_SHM);
    405403exit:       
    406404        /* Remove area */
     
    424422        int pm;
    425423
    426         an = async_req(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE],
    427                 NULL);
     424        an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]);
    428425        if (an < 0)
    429426                return;
    430427
    431428        pm = make_pixmap(_binary_anim_1_ppm_start,
    432                 (int) &_binary_anim_1_ppm_size);
     429            (int) &_binary_anim_1_ppm_size);
    433430        async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    434431
    435432        pm = make_pixmap(_binary_anim_2_ppm_start,
    436                 (int) &_binary_anim_2_ppm_size);
     433            (int) &_binary_anim_2_ppm_size);
    437434        async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    438435
    439436        pm = make_pixmap(_binary_anim_3_ppm_start,
    440                 (int) &_binary_anim_3_ppm_size);
     437            (int) &_binary_anim_3_ppm_size);
    441438        async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    442439
    443440        pm = make_pixmap(_binary_anim_4_ppm_start,
    444                 (int) &_binary_anim_4_ppm_size);
     441            (int) &_binary_anim_4_ppm_size);
    445442        async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    446443
    447         async_msg(fbphone, FB_ANIM_START, an);
     444        async_msg_1(fbphone, FB_ANIM_START, an);
    448445
    449446        animation = an;
     
    468465        fbphone = phone;
    469466
    470         rc = async_req_2(phone, FB_GET_RESOLUTION, 0, 0, &xres, &yres);
     467        rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres);
    471468        if (rc)
    472469                return;
     
    478475        /* Align width & height to character size */
    479476        console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP,
    480                 ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8),
    481                 ALIGN_DOWN(yres - (CONSOLE_TOP + CONSOLE_MARGIN), 16));
     477            ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8),
     478            ALIGN_DOWN(yres - (CONSOLE_TOP + CONSOLE_MARGIN), 16));
    482479        if (console_vp < 0)
    483480                return;
     
    487484        for (i = 0; i < CONSOLE_COUNT; i++) {
    488485                cstatus_vp[i] = vp_create(status_start + CONSOLE_MARGIN +
    489                         i * (STATUS_WIDTH + STATUS_SPACE), STATUS_TOP,
    490                         STATUS_WIDTH, STATUS_HEIGHT);
     486                    i * (STATUS_WIDTH + STATUS_SPACE), STATUS_TOP,
     487                    STATUS_WIDTH, STATUS_HEIGHT);
    491488                if (cstatus_vp[i] < 0)
    492489                        return;
     
    497494        /* Initialize icons */
    498495        ic_pixmaps[CONS_SELECTED] =
    499                 make_pixmap(_binary_cons_selected_ppm_start,
    500                 (int) &_binary_cons_selected_ppm_size);
     496            make_pixmap(_binary_cons_selected_ppm_start,
     497            (int) &_binary_cons_selected_ppm_size);
    501498        ic_pixmaps[CONS_IDLE] = make_pixmap(_binary_cons_idle_ppm_start,
    502                 (int) &_binary_cons_idle_ppm_size);
     499            (int) &_binary_cons_idle_ppm_size);
    503500        ic_pixmaps[CONS_HAS_DATA] =
    504                 make_pixmap(_binary_cons_has_data_ppm_start,
    505                 (int) &_binary_cons_has_data_ppm_size);
     501            make_pixmap(_binary_cons_has_data_ppm_start,
     502            (int) &_binary_cons_has_data_ppm_size);
    506503        ic_pixmaps[CONS_DISCONNECTED] =
    507                 make_pixmap(_binary_cons_idle_ppm_start,
    508                 (int) &_binary_cons_idle_ppm_size);
     504            make_pixmap(_binary_cons_idle_ppm_start,
     505            (int) &_binary_cons_idle_ppm_size);
    509506        ic_pixmaps[CONS_KERNEL] = make_pixmap(_binary_cons_kernel_ppm_start,
    510                 (int) &_binary_cons_kernel_ppm_size);
     507            (int) &_binary_cons_kernel_ppm_size);
    511508        ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED];
    512509       
  • uspace/srv/kbd/arch/ia32/src/mouse.c

    r8498915 r0cc4313  
    9595                        if (buf.u.val.leftbtn ^ leftbtn) {
    9696                                leftbtn = buf.u.val.leftbtn;
    97                                 async_msg(phoneid, KBD_MS_LEFT, leftbtn);
     97                                async_msg_1(phoneid, KBD_MS_LEFT, leftbtn);
    9898                        }
    9999                        if (buf.u.val.rightbtn & rightbtn) {
    100100                                rightbtn = buf.u.val.middlebtn;
    101                                 async_msg(phoneid, KBD_MS_RIGHT, rightbtn);
     101                                async_msg_1(phoneid, KBD_MS_RIGHT, rightbtn);
    102102                        }
    103103                        if (buf.u.val.rightbtn & rightbtn) {
    104104                                middlebtn = buf.u.val.middlebtn;
    105                                 async_msg(phoneid, KBD_MS_MIDDLE, middlebtn);
     105                                async_msg_1(phoneid, KBD_MS_MIDDLE, middlebtn);
    106106                        }
    107107                        x = bit9toint(buf.u.val.xsign, buf.u.val.x);
    108108                        y = bit9toint(buf.u.val.ysign, buf.u.val.y);
    109109                        if (x || y)
    110                                 async_msg_2(phoneid, KBD_MS_MOVE, (ipcarg_t)x, (ipcarg_t)(-y));
     110                                async_msg_2(phoneid, KBD_MS_MOVE, (ipcarg_t)x,
     111                                    (ipcarg_t)(-y));
    111112                }
    112113        }
  • uspace/srv/kbd/generic/kbd.c

    r8498915 r0cc4313  
    7777                                break;
    7878
    79                         async_msg(phone2cons, KBD_PUSHCHAR, chr);
     79                        async_msg_1(phone2cons, KBD_PUSHCHAR, chr);
    8080                }
    8181        }
Note: See TracChangeset for help on using the changeset viewer.