Changeset b74959bd in mainline for uspace/srv/fb


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

Modify ipc_answer_*() to make use of all six syscall arguments. The recommended
means of answering calls is via the ipc_answer_m() macros (where m denotes the
number of return arguments) that automatically decide between the fast register
version or the slow universal version of ipc_answer().

Location:
uspace/srv/fb
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/ega.c

    r3209923 rb74959bd  
    8383        int i;
    8484       
    85         for (i = 0; i < scr_width*scr_height; i++) {
     85        for (i = 0; i < scr_width * scr_height; i++) {
    8686                scr_addr[i * 2] = ' ';
    8787                scr_addr[i * 2 + 1] = style;
     
    126126        if (rows > 0) {
    127127                memcpy(scr_addr, ((char *) scr_addr) + rows * scr_width * 2,
    128                         scr_width * scr_height * 2 - rows * scr_width * 2);
     128                    scr_width * scr_height * 2 - rows * scr_width * 2);
    129129                for (i = 0; i < rows * scr_width; i++)
    130130                        (((short *) scr_addr) + scr_width * scr_height - rows *
    131                                 scr_width)[i] = ((style << 8) + ' ');
     131                            scr_width)[i] = ((style << 8) + ' ');
    132132        } else if (rows < 0) {
    133133                memcpy(((char *)scr_addr) - rows * scr_width * 2, scr_addr,
    134                         scr_width * scr_height * 2 + rows * scr_width * 2);
     134                    scr_width * scr_height * 2 + rows * scr_width * 2);
    135135                for (i = 0; i < -rows * scr_width; i++)
    136136                        ((short *)scr_addr)[i] = ((style << 8 ) + ' ');
     
    153153                scr_addr[i * 2] = data[i].character;
    154154                scr_addr[i * 2 + 1] = EGA_STYLE(data[i].style.fg_color,
    155                         data[i].style.bg_color);
     155                    data[i].style.bg_color);
    156156        }
    157157}
     
    161161        int i;
    162162
    163         for (i=0; (i < MAX_SAVED_SCREENS) && (saved_screens[i].data); i++)
     163        for (i = 0; (i < MAX_SAVED_SCREENS) && (saved_screens[i].data); i++)
    164164                ;
    165165        if (i == MAX_SAVED_SCREENS)
     
    176176        if (saved_screens[i].data)
    177177                memcpy(scr_addr, saved_screens[i].data, 2 * scr_width *
    178                         scr_height);
     178                    scr_height);
    179179        else
    180180                return EINVAL;
     
    196196
    197197        if (client_connected) {
    198                 ipc_answer_fast(iid, ELIMIT, 0,0);
     198                ipc_answer_0(iid, ELIMIT);
    199199                return;
    200200        }
    201201        client_connected = 1;
    202         ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */
     202        ipc_answer_0(iid, EOK); /* Accept connection */
    203203
    204204        while (1) {
     
    207207                case IPC_M_PHONE_HUNGUP:
    208208                        client_connected = 0;
    209                         ipc_answer_fast(callid, 0, 0, 0);
     209                        ipc_answer_0(callid, EOK);
    210210                        return; /* Exit thread */
    211211                case IPC_M_AS_AREA_SEND:
     
    213213                        intersize = IPC_GET_ARG2(call);
    214214                        if (intersize >= scr_width * scr_height *
    215                                 sizeof(*interbuf)) {
    216                                 receive_comm_area(callid, &call, (void *)
    217                                         &interbuf);
     215                            sizeof(*interbuf)) {
     216                                receive_comm_area(callid, &call,
     217                                    (void *) &interbuf);
    218218                                continue;
    219219                        }
     
    229229                        break;
    230230                case FB_GET_CSIZE:
    231                         ipc_answer_fast(callid, 0, scr_height, scr_width);
     231                        ipc_answer_2(callid, EOK, scr_height, scr_width);
    232232                        continue;
    233233                case FB_CLEAR:
     
    301301                        retval = ENOENT;
    302302                }
    303                 ipc_answer_fast(callid, retval, 0, 0);
     303                ipc_answer_0(callid, retval);
    304304        }
    305305}
     
    319319
    320320        physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >>
    321                 PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
     321            PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
    322322
    323323        async_set_client_connection(ega_client_connection);
  • uspace/srv/fb/fb.c

    r3209923 rb74959bd  
    166166{
    167167        *((uint32_t *) dst) = BLUE(rgb, 8) << 16 | GREEN(rgb, 8) << 8 |
    168                 RED(rgb, 8);
     168            RED(rgb, 8);
    169169}
    170170
     
    174174        int color = *(uint32_t *)(src);
    175175        return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) |
    176                 ((color >> 16) & 0xff);
     176            ((color >> 16) & 0xff);
    177177}
    178178
     
    209209        /* 5-bit, 5-bits, 5-bits */
    210210        *((uint16_t *)(dst)) = RED(rgb, 5) << 10 | GREEN(rgb, 5) << 5 |
    211                 BLUE(rgb, 5);
     211            BLUE(rgb, 5);
    212212}
    213213
     
    218218        int color = *(uint16_t *)(src);
    219219        return (((color >> 10) & 0x1f) << (16 + 3)) |
    220                 (((color >> 5) & 0x1f) << (8 + 3)) | ((color & 0x1f) << 3);
     220            (((color >> 5) & 0x1f) << (8 + 3)) | ((color & 0x1f) << 3);
    221221}
    222222
     
    227227        /* 5-bit, 6-bits, 5-bits */
    228228        *((uint16_t *)(dst)) = RED(rgb, 5) << 11 | GREEN(rgb, 6) << 5 |
    229                 BLUE(rgb, 5);
     229            BLUE(rgb, 5);
    230230}
    231231
     
    236236        int color = *(uint16_t *)(src);
    237237        return (((color >> 11) & 0x1f) << (16 + 3)) |
    238                 (((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3);
     238            (((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3);
    239239}
    240240
     
    252252        int color = *(uint8_t *)src;
    253253        return (((color >> 5) & 0x7) << (16 + 5)) |
    254                 (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5);
     254            (((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5);
    255255}
    256256
     
    270270        if (! (vport->paused && vport->dbdata))
    271271                (*screen.rgb2scr)(&screen.fbaddress[POINTPOS(dx,dy)],
    272                         COLOR(color));
     272                    COLOR(color));
    273273
    274274        if (vport->dbdata) {
     
    292292putpixel_mem(char *mem, unsigned int x, unsigned int y, int color)
    293293{
    294         (*screen.rgb2scr)(&mem[POINTPOS(x,y)], COLOR(color));
     294        (*screen.rgb2scr)(&mem[POINTPOS(x, y)], COLOR(color));
    295295}
    296296
     
    303303
    304304        if (!tmpline)
    305                 tmpline = malloc(screen.scanline*screen.pixelbytes);
     305                tmpline = malloc(screen.scanline * screen.pixelbytes);
    306306
    307307        /* Clear first line */
     
    316316                for (y = sy;y < sy+height; y++)
    317317                        memcpy(&screen.fbaddress[POINTPOS(sx,y)], tmpline,
    318                                screen.pixelbytes * width);
     318                            screen.pixelbytes * width);
    319319        }
    320320        if (vport->dbdata) {
     
    322322                        int rline = (y + vport->dboffset) % vport->height;
    323323                        int rpos = (rline * vport->width + sx) *
    324                                 screen.pixelbytes;
     324                            screen.pixelbytes;
    325325                        memcpy(&vport->dbdata[rpos], tmpline,
    326                                 screen.pixelbytes * width);
     326                            screen.pixelbytes * width);
    327327                }
    328328        }
     
    335335{
    336336        draw_rectangle(vport, 0, 0, vport->width, vport->height,
    337                 vport->style.bg_color);
     337            vport->style.bg_color);
    338338}
    339339
     
    351351                for (y = vport->y; y < vport->y+vport->height - lines; y++)
    352352                        memcpy(&screen.fbaddress[POINTPOS(vport->x,y)],
    353                                &screen.fbaddress[POINTPOS(vport->x,y + lines)],
    354                                screen.pixelbytes * vport->width);
     353                            &screen.fbaddress[POINTPOS(vport->x,y + lines)],
     354                            screen.pixelbytes * vport->width);
    355355                draw_rectangle(vport, 0, vport->height - lines, vport->width,
    356                         lines, vport->style.bg_color);
     356                    lines, vport->style.bg_color);
    357357        } else if (lines < 0) {
    358358                lines = -lines;
    359                 for (y = vport->y + vport->height-1; y >= vport->y + lines;
    360                          y--)
     359                for (y = vport->y + vport->height-1; y >= vport->y + lines; y--)
    361360                        memcpy(&screen.fbaddress[POINTPOS(vport->x,y)],
    362                                &screen.fbaddress[POINTPOS(vport->x,y - lines)],
    363                                screen.pixelbytes * vport->width);
     361                            &screen.fbaddress[POINTPOS(vport->x,y - lines)],
     362                            screen.pixelbytes * vport->width);
    364363                draw_rectangle(vport, 0, 0, vport->width, lines,
    365                         vport->style.bg_color);
     364                    vport->style.bg_color);
    366365        }
    367366}
     
    381380
    382381                memcpy(&screen.fbaddress[POINTPOS(dstx,dsty)],
    383                        &vport->dbdata[srcoff],
    384                        vport->width*screen.pixelbytes);
     382                    &vport->dbdata[srcoff], vport->width * screen.pixelbytes);
    385383        }
    386384}
     
    393391        if (lines > 0) {
    394392                draw_rectangle(vport, 0, 0, vport->width, lines,
    395                                vport->style.bg_color);
     393                    vport->style.bg_color);
    396394                vport->dboffset += lines;
    397395                vport->dboffset %= vport->height;
    398396        } else if (lines < 0) {
    399397                lines = -lines;
    400                 draw_rectangle(vport, 0, vport->height-lines,
    401                                vport->width, lines,
    402                                vport->style.bg_color);
     398                draw_rectangle(vport, 0, vport->height-lines, vport->width,
     399                    lines, vport->style.bg_color);
    403400
    404401                if (vport->dboffset < lines)
     
    442439 */
    443440static void
    444 draw_glyph(viewport_t *vport,uint8_t glyph, unsigned int sx,
    445          unsigned int sy, style_t style, int transparent)
     441draw_glyph(viewport_t *vport,uint8_t glyph, unsigned int sx, unsigned int sy,
     442    style_t style, int transparent)
    446443{
    447444        int i;
     
    453450                for (i = 0; i < 8; i++) {
    454451                        if (glline & (1 << (7 - i)))
    455                                 putpixel(vport, sx + i, sy + y,
    456                                         style.fg_color);
     452                                putpixel(vport, sx + i, sy + y, style.fg_color);
    457453                        else if (!transparent)
    458                                 putpixel(vport, sx + i, sy + y,
    459                                         style.bg_color);
     454                                putpixel(vport, sx + i, sy + y, style.bg_color);
    460455                }
    461456        }
     
    472467                for (y = 0; y < FONT_SCANLINES; y++)
    473468                        invert_pixel(vport, col * COL_WIDTH + x, row *
    474                                 FONT_SCANLINES + y);
     469                            FONT_SCANLINES + y);
    475470}
    476471
     
    631626       
    632627        draw_glyph(vport, c, col * COL_WIDTH, row * FONT_SCANLINES, style,
    633                 transparent);
     628            transparent);
    634629
    635630        vport->cur_col = col;
     
    660655        for (i = 0; i < vport->cols * vport->rows; i++) {
    661656                if (data[i].character == ' ' && style_same(data[i].style,
    662                         vport->style))
     657                    vport->style))
    663658                        continue;
    664659                col = i % vport->cols;
    665660                row = i / vport->cols;
    666661                draw_glyph(vport, data[i].character, col * COL_WIDTH, row *
    667                         FONT_SCANLINES, data[i].style,
    668                         style_same(data[i].style,vport->style));
     662                    FONT_SCANLINES, data[i].style, style_same(data[i].style,
     663                    vport->style));
    669664        }
    670665        cursor_print(vport);
     
    712707
    713708        ppm_draw(shm, size, 0, 0, pmap->width, pmap->height,
    714                 (putpixel_cb_t)putpixel_pixmap, (void *)pm);
     709            (putpixel_cb_t)putpixel_pixmap, (void *)pm);
    715710
    716711        return pm;
     
    758753                        void *dest = as_get_mappable_page(IPC_GET_ARG2(*call));
    759754                        shm_size = IPC_GET_ARG2(*call);
    760                         if (!ipc_answer_fast(callid, 0, (sysarg_t) dest, 0))
     755                        if (!ipc_answer_1(callid, EOK, (sysarg_t) dest))
    761756                                shm = dest;
    762757                        else
     
    806801               
    807802                ppm_draw(shm, shm_size, IPC_GET_ARG1(*call),
    808                         IPC_GET_ARG2(*call), vport->width - x,
    809                         vport->height - y, (putpixel_cb_t)putpixel, vport);
     803                    IPC_GET_ARG2(*call), vport->width - x, vport->height - y,
     804                    (putpixel_cb_t)putpixel, vport);
    810805                break;
    811806        case FB_DRAW_TEXT_DATA:
     
    815810                }
    816811                if (intersize < vport->cols * vport->rows *
    817                         sizeof(*interbuffer)) {
     812                    sizeof(*interbuffer)) {
    818813                        retval = EINVAL;
    819814                        break;
     
    826821       
    827822        if (handled)
    828                 ipc_answer_fast(callid, retval, 0, 0);
     823                ipc_answer_0(callid, retval);
    829824        return handled;
    830825}
     
    852847        for (y = 0; y < realheight; y++) {
    853848                tmp = (vport->y + y) * screen.scanline +
    854                         vport->x * screen.pixelbytes;
     849                    vport->x * screen.pixelbytes;
    855850                memcpy(pmap->data + srcrowsize * y, screen.fbaddress + tmp,
    856                         realrowsize);
     851                    realrowsize);
    857852        }
    858853}
     
    913908        for (y = 0; y < realheight; y++) {
    914909                tmp = (vport->y + y) * screen.scanline +
    915                         vport->x * screen.pixelbytes;
     910                    vport->x * screen.pixelbytes;
    916911                memcpy(screen.fbaddress + tmp, pmap->data + y * srcrowsize,
    917                         realrowsize);
     912                    realrowsize);
    918913        }
    919914        return 0;
     
    934929        for (i = 0; i < MAX_ANIMATIONS; i++) {
    935930                if (!animations[i].animlen || !animations[i].initialized ||
    936                         !animations[i].enabled)
     931                    !animations[i].enabled)
    937932                        continue;
    938933                draw_pixmap(animations[i].vp,
    939                         animations[i].pixmaps[animations[i].pos]);
     934                    animations[i].pixmaps[animations[i].pos]);
    940935                animations[i].pos = (animations[i].pos + 1) %
    941                         animations[i].animlen;
     936                    animations[i].animlen;
    942937        }
    943938}
     
    963958        if (pointer_vport == -1) {
    964959                pointer_vport = viewport_create(pointer_x, pointer_y,
    965                         pointer_width, pointer_height);
     960                    pointer_width, pointer_height);
    966961                if (pointer_vport < 0)
    967962                        return;
     
    975970        else
    976971                copy_vp_to_pixmap(&viewports[pointer_vport],
    977                         &pixmaps[pointer_pixmap]);
     972                    &pixmaps[pointer_pixmap]);
    978973
    979974        /* Draw cursor */
     
    982977                        bytepos = i * ((pointer_width - 1) / 8 + 1) + j / 8;
    983978                        visibility = pointer_mask_bits[bytepos] &
    984                                 (1 << (j % 8));
     979                            (1 << (j % 8));
    985980                        if (visibility) {
    986                                 color = pointer_bits[bytepos] & (1 << (j % 8))
    987                                         ? 0 : 0xffffff;
     981                                color = pointer_bits[bytepos] &
     982                                    (1 << (j % 8)) ? 0 : 0xffffff;
    988983                                if (pointer_x + j < screen.xres && pointer_y +
    989                                         i < screen.yres)
     984                                    i < screen.yres)
    990985                                        putpixel(&viewports[0], pointer_x + j,
    991                                                 pointer_y + i, color);
     986                                            pointer_y + i, color);
    992987                        }
    993988                }
     
    11071102        }
    11081103        if (handled)
    1109                 ipc_answer_fast(callid, retval, 0, 0);
     1104                ipc_answer_0(callid, retval);
    11101105        return handled;
    11111106}
     
    11581153
    11591154        if (handled)
    1160                 ipc_answer_fast(callid, retval, 0, 0);
     1155                ipc_answer_0(callid, retval);
    11611156        return handled;
    11621157       
     
    11801175
    11811176        if (client_connected) {
    1182                 ipc_answer_fast(iid, ELIMIT, 0,0);
     1177                ipc_answer_0(iid, ELIMIT);
    11831178                return;
    11841179        }
    11851180        client_connected = 1;
    1186         ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */
     1181        ipc_answer_0(iid, EOK); /* Accept connection */
    11871182
    11881183        while (1) {
     
    12231218                                break;
    12241219                        }
    1225                         ipc_answer_fast(callid, 0, 0, 0);
     1220                        ipc_answer_0(callid, EOK);
    12261221
    12271222                        draw_char(vport, c, row, col, vport->style,
    1228                                 IPC_GET_METHOD(call) == FB_TRANS_PUTCHAR);
     1223                            IPC_GET_METHOD(call) == FB_TRANS_PUTCHAR);
    12291224                        continue; /* msg already answered */
    12301225                case FB_CLEAR:
     
    12531248                        break;
    12541249                case FB_GET_CSIZE:
    1255                         ipc_answer_fast(callid, 0, vport->rows, vport->cols);
     1250                        ipc_answer_2(callid, EOK, vport->rows, vport->cols);
    12561251                        continue;
    12571252                case FB_SCROLL:
     
    12751270                                break;
    12761271                        }
    1277                         if (! viewports[i].initialized ) {
     1272                        if (!viewports[i].initialized ) {
    12781273                                retval = EADDRNOTAVAIL;
    12791274                                break;
     
    12811276                        viewports[i].dboffset = 0;
    12821277                        if (IPC_GET_ARG2(call) == 1 && !viewports[i].dbdata)
    1283                                 viewports[i].dbdata = malloc(screen.pixelbytes
    1284                                         * viewports[i].width *
    1285                                         viewports[i].height);
     1278                                viewports[i].dbdata =
     1279                                    malloc(screen.pixelbytes *
     1280                                    viewports[i].width * viewports[i].height);
    12861281                        else if (IPC_GET_ARG2(call) == 0 &&
    1287                                 viewports[i].dbdata) {
     1282                            viewports[i].dbdata) {
    12881283                                free(viewports[i].dbdata);
    12891284                                viewports[i].dbdata = NULL;
     
    13091304                case FB_VIEWPORT_CREATE:
    13101305                        retval = viewport_create(IPC_GET_ARG1(call) >> 16,
    1311                                 IPC_GET_ARG1(call) & 0xffff,
    1312                                 IPC_GET_ARG2(call) >> 16,
    1313                                 IPC_GET_ARG2(call) & 0xffff);
     1306                            IPC_GET_ARG1(call) & 0xffff,
     1307                            IPC_GET_ARG2(call) >> 16,
     1308                            IPC_GET_ARG2(call) & 0xffff);
    13141309                        break;
    13151310                case FB_VIEWPORT_DELETE:
     
    13361331                        break;
    13371332                case FB_GET_RESOLUTION:
    1338                         ipc_answer_fast(callid, 0, screen.xres,screen.yres);
     1333                        ipc_answer_2(callid, EOK, screen.xres, screen.yres);
    13391334                        continue;
    13401335                case FB_POINTER_MOVE:
     
    13461341                        retval = ENOENT;
    13471342                }
    1348                 ipc_answer_fast(callid,retval, 0, 0);
     1343                ipc_answer_0(callid, retval);
    13491344        }
    13501345}
     
    13761371       
    13771372        physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >>
    1378                 PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
     1373            PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE);
    13791374
    13801375        if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual,
    1381                 fb_invert_colors))
     1376            fb_invert_colors))
    13821377                return 0;
    13831378       
  • uspace/srv/fb/main.c

    r3209923 rb74959bd  
    4545
    4646        dest = as_get_mappable_page(IPC_GET_ARG2(*call));
    47         if (ipc_answer_fast(callid, 0, (sysarg_t) dest, 0) == 0) {
     47        if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
    4848                if (*area)
    4949                        as_area_destroy(*area);
  • uspace/srv/fb/sysio.c

    r3209923 rb74959bd  
    118118
    119119        if (client_connected) {
    120                 ipc_answer_fast(iid, ELIMIT, 0,0);
     120                ipc_answer_0(iid, ELIMIT);
    121121                return;
    122122        }
    123123       
    124124        client_connected = 1;
    125         ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */
     125        ipc_answer_0(iid, EOK); /* Accept connection */
    126126        while (1) {
    127127                callid = async_get_call(&call);
    128128                switch (IPC_GET_METHOD(call)) {
    129                         case IPC_M_PHONE_HUNGUP:
    130                                 client_connected = 0;
    131                                 ipc_answer_fast(callid, 0, 0, 0);
    132                                 return; /* Exit thread */
    133                         case FB_PUTCHAR:
    134                                 c = IPC_GET_ARG1(call);
    135                                 newrow = IPC_GET_ARG2(call);
    136                                 newcol = IPC_GET_ARG3(call);
    137                                 if ((lastcol != newcol) || (lastrow != newrow))
    138                                         curs_goto(newrow, newcol);
    139                                 lastcol = newcol + 1;
    140                                 lastrow = newrow;
    141                                 sysput(c);
    142                                 retval = 0;
     129                case IPC_M_PHONE_HUNGUP:
     130                        client_connected = 0;
     131                        ipc_answer_0(callid, EOK);
     132                        return; /* Exit thread */
     133                case FB_PUTCHAR:
     134                        c = IPC_GET_ARG1(call);
     135                        newrow = IPC_GET_ARG2(call);
     136                        newcol = IPC_GET_ARG3(call);
     137                        if ((lastcol != newcol) || (lastrow != newrow))
     138                                curs_goto(newrow, newcol);
     139                        lastcol = newcol + 1;
     140                        lastrow = newrow;
     141                        sysput(c);
     142                        retval = 0;
     143                        break;
     144                case FB_CURSOR_GOTO:
     145                        newrow = IPC_GET_ARG1(call);
     146                        newcol = IPC_GET_ARG2(call);
     147                        curs_goto(newrow, newcol);
     148                        lastrow = newrow;
     149                        lastcol = newcol;
     150                        retval = 0;
     151                        break;
     152                case FB_GET_CSIZE:
     153                        ipc_answer_2(callid, EOK, HEIGHT, WIDTH);
     154                        continue;
     155                case FB_CLEAR:
     156                        clrscr();
     157                        retval = 0;
     158                        break;
     159                case FB_SET_STYLE:
     160                        fgcolor = IPC_GET_ARG1(call);
     161                        bgcolor = IPC_GET_ARG2(call);
     162                        if (fgcolor < bgcolor)
     163                                set_style(0);
     164                        else
     165                                set_style(7);
     166                        retval = 0;
     167                        break;
     168                case FB_SCROLL:
     169                        i = IPC_GET_ARG1(call);
     170                        if ((i > HEIGHT) || (i < -HEIGHT)) {
     171                                retval = EINVAL;
    143172                                break;
    144                         case FB_CURSOR_GOTO:
    145                                 newrow = IPC_GET_ARG1(call);
    146                                 newcol = IPC_GET_ARG2(call);
    147                                 curs_goto(newrow, newcol);
    148                                 lastrow = newrow;
    149                                 lastcol = newcol;
    150                                 retval = 0;
    151                                 break;
    152                         case FB_GET_CSIZE:
    153                                 ipc_answer_fast(callid, 0, HEIGHT, WIDTH);
    154                                 continue;
    155                         case FB_CLEAR:
    156                                 clrscr();
    157                                 retval = 0;
    158                                 break;
    159                         case FB_SET_STYLE:
    160                                 fgcolor = IPC_GET_ARG1(call);
    161                                 bgcolor = IPC_GET_ARG2(call);
    162                                 if (fgcolor < bgcolor)
    163                                         set_style(0);
    164                                 else
    165                                         set_style(7);
    166                                 retval = 0;
    167                                 break;
    168                         case FB_SCROLL:
    169                                 i = IPC_GET_ARG1(call);
    170                                 if ((i > HEIGHT) || (i < -HEIGHT)) {
    171                                         retval = EINVAL;
    172                                         break;
    173                                 }
    174                                 scroll(i);
    175                                 curs_goto(lastrow, lastcol);
    176                                 retval = 0;
    177                                 break;
    178                         default:
    179                                 retval = ENOENT;
     173                        }
     174                        scroll(i);
     175                        curs_goto(lastrow, lastcol);
     176                        retval = 0;
     177                        break;
     178                default:
     179                        retval = ENOENT;
    180180                }
    181181               
    182                 ipc_answer_fast(callid, retval, 0, 0);
     182                ipc_answer_0(callid, retval);
    183183        }
    184184}
Note: See TracChangeset for help on using the changeset viewer.