Rev 2619 | Rev 2635 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2619 | Rev 2621 | ||
---|---|---|---|
Line 103... | Line 103... | ||
103 | return -1; |
103 | return -1; |
104 | } |
104 | } |
105 | 105 | ||
106 | static void clrscr(void) |
106 | static void clrscr(void) |
107 | { |
107 | { |
108 | async_msg(fb_info.phone, FB_CLEAR, 0); |
108 | async_msg_0(fb_info.phone, FB_CLEAR); |
109 | } |
109 | } |
110 | 110 | ||
111 | static void curs_visibility(int v) |
111 | static void curs_visibility(int v) |
112 | { |
112 | { |
113 | async_msg(fb_info.phone, FB_CURSOR_VISIBILITY, v); |
113 | async_msg_1(fb_info.phone, FB_CURSOR_VISIBILITY, v); |
114 | } |
114 | } |
115 | 115 | ||
116 | static void curs_goto(int row, int col) |
116 | static void curs_goto(int row, int col) |
117 | { |
117 | { |
118 | async_msg_2(fb_info.phone, FB_CURSOR_GOTO, row, col); |
118 | async_msg_2(fb_info.phone, FB_CURSOR_GOTO, row, col); |
Line 174... | Line 174... | ||
174 | if (scr->position_y >= scr->size_y) { |
174 | if (scr->position_y >= scr->size_y) { |
175 | scr->position_y = scr->size_y - 1; |
175 | scr->position_y = scr->size_y - 1; |
176 | screenbuffer_clear_line(scr, scr->top_line); |
176 | screenbuffer_clear_line(scr, scr->top_line); |
177 | scr->top_line = (scr->top_line + 1) % scr->size_y; |
177 | scr->top_line = (scr->top_line + 1) % scr->size_y; |
178 | if (console == active_console) |
178 | if (console == active_console) |
179 | async_msg(fb_info.phone, FB_SCROLL, 1); |
179 | async_msg_1(fb_info.phone, FB_SCROLL, 1); |
180 | } |
180 | } |
181 | 181 | ||
182 | scr->position_x = scr->position_x % scr->size_x; |
182 | scr->position_x = scr->position_x % scr->size_x; |
183 | 183 | ||
184 | if (console == active_console) |
184 | if (console == active_console) |
Line 194... | Line 194... | ||
194 | static int switch_screens(int oldpixmap) |
194 | static int switch_screens(int oldpixmap) |
195 | { |
195 | { |
196 | int newpmap; |
196 | int newpmap; |
197 | 197 | ||
198 | /* Save screen */ |
198 | /* Save screen */ |
199 | newpmap = async_req(fb_info.phone, FB_VP2PIXMAP, 0, NULL); |
199 | newpmap = async_req_0_0(fb_info.phone, FB_VP2PIXMAP); |
200 | if (newpmap < 0) |
200 | if (newpmap < 0) |
201 | return -1; |
201 | return -1; |
202 | 202 | ||
203 | if (oldpixmap != -1) { |
203 | if (oldpixmap != -1) { |
204 | /* Show old screen */ |
204 | /* Show old screen */ |
205 | async_msg_2(fb_info.phone, FB_VP_DRAW_PIXMAP, 0, oldpixmap); |
205 | async_msg_2(fb_info.phone, FB_VP_DRAW_PIXMAP, 0, oldpixmap); |
206 | /* Drop old pixmap */ |
206 | /* Drop old pixmap */ |
207 | async_msg(fb_info.phone, FB_DROP_PIXMAP, oldpixmap); |
207 | async_msg_1(fb_info.phone, FB_DROP_PIXMAP, oldpixmap); |
208 | } |
208 | } |
209 | 209 | ||
210 | return newpmap; |
210 | return newpmap; |
211 | } |
211 | } |
212 | 212 | ||
Line 264... | Line 264... | ||
264 | size_x = conn->screenbuffer.size_x; |
264 | size_x = conn->screenbuffer.size_x; |
265 | interbuffer[i + j * size_x] = |
265 | interbuffer[i + j * size_x] = |
266 | *get_field_at(&conn->screenbuffer, i, j); |
266 | *get_field_at(&conn->screenbuffer, i, j); |
267 | } |
267 | } |
268 | /* This call can preempt, but we are already at the end */ |
268 | /* 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, |
269 | rc = async_req_0_0(fb_info.phone, FB_DRAW_TEXT_DATA); |
270 | NULL); |
- | |
271 | } |
270 | } |
272 | 271 | ||
273 | if ((!interbuffer) || (rc != 0)) { |
272 | if ((!interbuffer) || (rc != 0)) { |
274 | set_style(&conn->screenbuffer.style); |
273 | set_style(&conn->screenbuffer.style); |
275 | clrscr(); |
274 | clrscr(); |
Line 413... | Line 412... | ||
413 | gcons_notify_char(consnum); |
412 | gcons_notify_char(consnum); |
414 | break; |
413 | break; |
415 | case CONSOLE_CLEAR: |
414 | case CONSOLE_CLEAR: |
416 | /* Send message to fb */ |
415 | /* Send message to fb */ |
417 | if (consnum == active_console) { |
416 | if (consnum == active_console) { |
418 | async_msg(fb_info.phone, FB_CLEAR, 0); |
417 | async_msg_0(fb_info.phone, FB_CLEAR); |
419 | } |
418 | } |
420 | 419 | ||
421 | screenbuffer_clear(&conn->screenbuffer); |
420 | screenbuffer_clear(&conn->screenbuffer); |
422 | 421 | ||
423 | break; |
422 | break; |
Line 432... | Line 431... | ||
432 | arg1 = fb_info.rows; |
431 | arg1 = fb_info.rows; |
433 | arg2 = fb_info.cols; |
432 | arg2 = fb_info.cols; |
434 | break; |
433 | break; |
435 | case CONSOLE_FLUSH: |
434 | case CONSOLE_FLUSH: |
436 | if (consnum == active_console) |
435 | if (consnum == active_console) |
437 | async_req_2(fb_info.phone, FB_FLUSH, 0, 0, |
436 | async_req_0_0(fb_info.phone, FB_FLUSH); |
438 | NULL, NULL); |
- | |
439 | break; |
437 | break; |
440 | case CONSOLE_SET_STYLE: |
438 | case CONSOLE_SET_STYLE: |
441 | arg1 = IPC_GET_ARG1(call); |
439 | arg1 = IPC_GET_ARG1(call); |
442 | arg2 = IPC_GET_ARG2(call); |
440 | arg2 = IPC_GET_ARG2(call); |
443 | screenbuffer_set_style(&conn->screenbuffer, arg1, |
441 | screenbuffer_set_style(&conn->screenbuffer, arg1, |
Line 506... | Line 504... | ||
506 | kernel_pixmap = switch_screens(-1); |
504 | kernel_pixmap = switch_screens(-1); |
507 | 505 | ||
508 | /* Initialize gcons */ |
506 | /* Initialize gcons */ |
509 | gcons_init(fb_info.phone); |
507 | gcons_init(fb_info.phone); |
510 | /* Synchronize, the gcons can have something in queue */ |
508 | /* 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); |
512 | /* Enable double buffering */ |
510 | /* Enable double buffering */ |
513 | async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1); |
511 | async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1); |
514 | 512 | ||
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, |
516 | &fb_info.cols); |
514 | &fb_info.cols); |
517 | set_style_col(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND); |
515 | set_style_col(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND); |
518 | clrscr(); |
516 | clrscr(); |
519 | 517 | ||
520 | /* Init virtual consoles */ |
518 | /* Init virtual consoles */ |
Line 537... | Line 535... | ||
537 | 535 | ||
538 | interbuffer = mmap(NULL, |
536 | interbuffer = mmap(NULL, |
539 | sizeof(keyfield_t) * fb_info.cols * fb_info.rows, |
537 | sizeof(keyfield_t) * fb_info.cols * fb_info.rows, |
540 | PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); |
538 | PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); |
541 | if (!interbuffer) { |
539 | if (!interbuffer) { |
542 | if (async_req_3(fb_info.phone, IPC_M_AS_AREA_SEND, |
540 | if (async_req_3_0(fb_info.phone, IPC_M_AS_AREA_SEND, |
543 | (ipcarg_t) interbuffer, 0, AS_AREA_READ, NULL, NULL, |
541 | (ipcarg_t) interbuffer, 0, AS_AREA_READ) != 0) { |
544 | NULL) != 0) { |
- | |
545 | munmap(interbuffer, |
542 | munmap(interbuffer, |
546 | sizeof(keyfield_t) * fb_info.cols * fb_info.rows); |
543 | sizeof(keyfield_t) * fb_info.cols * fb_info.rows); |
547 | interbuffer = NULL; |
544 | interbuffer = NULL; |
548 | } |
545 | } |
549 | } |
546 | } |