Subversion Repositories HelenOS-historic

Rev

Rev 1592 | Rev 1646 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1592 Rev 1610
Line 73... Line 73...
73
 
73
 
74
static int active_console = 0;
74
static int active_console = 0;
75
 
75
 
76
static void vp_switch(int vp)
76
static void vp_switch(int vp)
77
{
77
{
78
    nsend_call(fbphone,FB_VIEWPORT_SWITCH, vp);
78
    async_msg(fbphone,FB_VIEWPORT_SWITCH, vp);
79
}
79
}
80
 
80
 
81
/** Create view port */
81
/** Create view port */
82
static int vp_create(unsigned int x, unsigned int y,
82
static int vp_create(unsigned int x, unsigned int y,
83
             unsigned int width, unsigned int height)
83
             unsigned int width, unsigned int height)
Line 88... Line 88...
88
                   NULL, NULL);
88
                   NULL, NULL);
89
}
89
}
90
 
90
 
91
static void clear(void)
91
static void clear(void)
92
{
92
{
93
    nsend_call(fbphone, FB_CLEAR, 0);
93
    async_msg(fbphone, FB_CLEAR, 0);
94
   
94
   
95
}
95
}
96
 
96
 
97
static void set_style(int fgcolor, int bgcolor)
97
static void set_style(int fgcolor, int bgcolor)
98
{
98
{
99
    nsend_call_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor);
99
    async_msg_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor);
100
}
100
}
101
 
101
 
102
/** Transparent putchar */
102
/** Transparent putchar */
103
static void tran_putch(char c, int row, int col)
103
static void tran_putch(char c, int row, int col)
104
{
104
{
105
    nsend_call_3(fbphone, FB_TRANS_PUTCHAR, c, row, col);
105
    async_msg_3(fbphone, FB_TRANS_PUTCHAR, c, row, col);
106
}
106
}
107
 
107
 
108
/** Redraw the button showing state of a given console */
108
/** Redraw the button showing state of a given console */
109
static void redraw_state(int consnum)
109
static void redraw_state(int consnum)
110
{
110
{
Line 112... Line 112...
112
    int i;
112
    int i;
113
    enum butstate state = console_state[consnum];
113
    enum butstate state = console_state[consnum];
114
 
114
 
115
    vp_switch(cstatus_vp[consnum]);
115
    vp_switch(cstatus_vp[consnum]);
116
    if (ic_pixmaps[state] != -1)
116
    if (ic_pixmaps[state] != -1)
117
        nsend_call_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], ic_pixmaps[state]);
117
        async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], ic_pixmaps[state]);
118
 
118
 
119
    if (state != CONS_DISCONNECTED && state != CONS_KERNEL && state != CONS_DISCONNECTED_SEL) {
119
    if (state != CONS_DISCONNECTED && state != CONS_KERNEL && state != CONS_DISCONNECTED_SEL) {
120
        snprintf(data, 5, "%d", consnum+1);
120
        snprintf(data, 5, "%d", consnum+1);
121
        for (i=0;data[i];i++)
121
        for (i=0;data[i];i++)
122
            tran_putch(data[i], 1, 2+i);
122
            tran_putch(data[i], 1, 2+i);
Line 236... Line 236...
236
    if (shm == MAP_FAILED)
236
    if (shm == MAP_FAILED)
237
        return;
237
        return;
238
 
238
 
239
    memcpy(shm, logo, size);
239
    memcpy(shm, logo, size);
240
    /* Send area */
240
    /* Send area */
241
    rc = sync_send_2(fbphone, FB_PREPARE_SHM, (ipcarg_t)shm, 0, NULL, NULL);
241
    rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t)shm, 0, NULL, NULL);
242
    if (rc)
242
    if (rc)
243
        goto exit;
243
        goto exit;
244
    rc = sync_send_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t)shm, 0, PROTO_READ, NULL, NULL, NULL);
244
    rc = async_req_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t)shm, 0, PROTO_READ, NULL, NULL, NULL);
245
    if (rc)
245
    if (rc)
246
        goto drop;
246
        goto drop;
247
    /* Draw logo */
247
    /* Draw logo */
248
    nsend_call_2(fbphone, FB_DRAW_PPM, x, y);
248
    async_msg_2(fbphone, FB_DRAW_PPM, x, y);
249
drop:
249
drop:
250
    /* Drop area */
250
    /* Drop area */
251
    nsend_call(fbphone, FB_DROP_SHM, 0);
251
    async_msg(fbphone, FB_DROP_SHM, 0);
252
exit:      
252
exit:      
253
    /* Remove area */
253
    /* Remove area */
254
    munmap(shm, size);
254
    munmap(shm, size);
255
}
255
}
256
 
256
 
Line 295... Line 295...
295
    if (shm == MAP_FAILED)
295
    if (shm == MAP_FAILED)
296
        return -1;
296
        return -1;
297
 
297
 
298
    memcpy(shm, data, size);
298
    memcpy(shm, data, size);
299
    /* Send area */
299
    /* Send area */
300
    rc = sync_send_2(fbphone, FB_PREPARE_SHM, (ipcarg_t)shm, 0, NULL, NULL);
300
    rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t)shm, 0, NULL, NULL);
301
    if (rc)
301
    if (rc)
302
        goto exit;
302
        goto exit;
303
    rc = sync_send_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t)shm, 0, PROTO_READ, NULL, NULL, NULL);
303
    rc = async_req_3(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t)shm, 0, PROTO_READ, NULL, NULL, NULL);
304
    if (rc)
304
    if (rc)
305
        goto drop;
305
        goto drop;
306
 
306
 
307
    /* Obtain pixmap */
307
    /* Obtain pixmap */
308
    rc = sync_send(fbphone, FB_SHM2PIXMAP, 0, NULL);
308
    rc = async_req(fbphone, FB_SHM2PIXMAP, 0, NULL);
309
    if (rc < 0)
309
    if (rc < 0)
310
        goto drop;
310
        goto drop;
311
    pxid = rc;
311
    pxid = rc;
312
drop:
312
drop:
313
    /* Drop area */
313
    /* Drop area */
314
    nsend_call(fbphone, FB_DROP_SHM, 0);
314
    async_msg(fbphone, FB_DROP_SHM, 0);
315
exit:      
315
exit:      
316
    /* Remove area */
316
    /* Remove area */
317
    munmap(shm, size);
317
    munmap(shm, size);
318
 
318
 
319
    return pxid;
319
    return pxid;