Changeset b1f51f0 in mainline for console/console.c


Ignore:
Timestamp:
2006-06-02T16:09:18Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b917098
Parents:
a116ef22
Message:

Changed recommended way of asynchronous communication.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • console/console.c

    ra116ef22 rb1f51f0  
    4242#include <sys/mman.h>
    4343
    44 #define CONSOLE_COUNT 12
    4544#define MAX_KEYREQUESTS_BUFFERED 32
    4645
     
    119118
    120119                        if (console == active_console) {
    121                                 ipc_call_async_3(fb_info.phone, FB_PUTCHAR, ' ', scr->position_y, scr->position_x, NULL, NULL);
     120                                nsend_call_3(fb_info.phone, FB_PUTCHAR, ' ', scr->position_y, scr->position_x);
    122121                        }
    123122       
     
    127126                default:       
    128127                        if (console == active_console) {
    129                                 ipc_call_async_3(fb_info.phone, FB_PUTCHAR, key, scr->position_y, scr->position_x, NULL, NULL);
     128                                nsend_call_3(fb_info.phone, FB_PUTCHAR, key, scr->position_y, scr->position_x);
    130129                        }
    131130       
     
    139138                scr->position_y = scr->size_y - 1;
    140139                screenbuffer_clear_line(scr, scr->top_line++);
    141                 ipc_call_async(fb_info.phone, FB_SCROLL, 1, NULL, NULL);
     140                if (console == active_console)
     141                        nsend_call(fb_info.phone, FB_SCROLL, 1);
    142142        }
    143143       
     
    145145       
    146146        if (console == active_console) 
    147                 ipc_call_async_2(fb_info.phone, FB_CURSOR_GOTO, scr->position_y, scr->position_x, NULL, NULL);
     147                send_call_2(fb_info.phone, FB_CURSOR_GOTO, scr->position_y, scr->position_x);
    148148       
    149149}
     
    193193                                conn = &connections[active_console];
    194194
    195                                 ipc_call_async(fb_info.phone, FB_CURSOR_VISIBILITY, 0, NULL, NULL);
     195                                nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 0);
    196196               
    197197                                if (interbuffer) {
     
    202202                                        sync_send_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL, NULL);               
    203203                                } else {
    204 
    205                                         ipc_call_async_2(fb_info.phone, FB_CLEAR, 0, 0, NULL, NULL);
     204                                        nsend_call(fb_info.phone, FB_CLEAR, 0);
    206205                               
    207206                                       
     
    210209                                                        d = get_field_at(&(conn->screenbuffer),i, j)->character;
    211210                                                        if (d && d != ' ')
    212                                                                 ipc_call_async_3(fb_info.phone, FB_PUTCHAR, d, j, i, NULL, NULL);
     211                                                                nsend_call_3(fb_info.phone, FB_PUTCHAR, d, j, i);
    213212                                                }
    214213
    215214                                }
    216                                 ipc_call_async_2(fb_info.phone, FB_CURSOR_GOTO, conn->screenbuffer.position_y, conn->screenbuffer.position_x, NULL, NULL);
    217                                 ipc_call_async_2(fb_info.phone, FB_SET_STYLE, conn->screenbuffer.style.fg_color, \
    218                                                 conn->screenbuffer.style.bg_color, NULL, NULL);
    219                                 ipc_call_async(fb_info.phone, FB_CURSOR_VISIBILITY, 1, NULL, NULL);
     215                                nsend_call_2(fb_info.phone, FB_CURSOR_GOTO, conn->screenbuffer.position_y, conn->screenbuffer.position_x);
     216                                nsend_call_2(fb_info.phone, FB_SET_STYLE, conn->screenbuffer.style.fg_color, \
     217                                                conn->screenbuffer.style.bg_color);
     218                                send_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1);
    220219
    221220                                break;
     
    241240
    242241/** Default thread for new connections */
    243 void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     242static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
    244243{
    245244        ipc_callid_t callid;
     
    273272                        /* Send message to fb */
    274273                        if (consnum == active_console) {
    275                                 ipc_call_async_2(fb_info.phone, FB_CLEAR, 0, 0, NULL, NULL);
     274                                send_call(fb_info.phone, FB_CLEAR, 0);
    276275                        }
    277276                       
     
    331330       
    332331        ipc_call_sync_2(fb_info.phone, FB_GET_CSIZE, 0, 0, &(fb_info.rows), &(fb_info.cols));
    333         ipc_call_async_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR, NULL, NULL);
    334         ipc_call_sync(fb_info.phone, FB_CURSOR_VISIBILITY, 1, NULL);
     332        nsend_call_2(fb_info.phone, FB_SET_STYLE, DEFAULT_FOREGROUND_COLOR, DEFAULT_BACKGROUND_COLOR);
     333        nsend_call(fb_info.phone, FB_CURSOR_VISIBILITY, 1);
    335334       
    336335        /* Init virtual consoles */
     
    362361        async_new_connection(phonehash, 0, NULL, keyboard_events);
    363362       
    364         ipc_call_async_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0, NULL, NULL);
    365 
     363        nsend_call_2(fb_info.phone, FB_CURSOR_GOTO, 0, 0);
     364
     365        /* Register at NS */
    366366        if (ipc_connect_to_me(PHONE_NS, SERVICE_CONSOLE, 0, &phonehash) != 0) {
    367367                return -1;
Note: See TracChangeset for help on using the changeset viewer.