Changeset b74959bd in mainline for uspace/srv/fb/ega.c


Ignore:
Timestamp:
2007-11-20T21:33:32Z (17 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().

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.