Changeset 085bd54 in mainline for console/console.c
- Timestamp:
- 2006-06-06T15:16:08Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63bb83e
- Parents:
- d7eafd8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
console/console.c
rd7eafd8 r085bd54 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /* TODO: remove */ 29 #include <stdio.h> 28 30 29 31 … … 92 94 static void clrscr(void) 93 95 { 94 nsend_call(fb_info.phone, FB_CLEAR, 0);96 async_msg(fb_info.phone, FB_CLEAR, 0); 95 97 } 96 98 97 99 static void curs_visibility(int v) 98 100 { 99 send_call(fb_info.phone, FB_CURSOR_VISIBILITY, v);101 async_msg(fb_info.phone, FB_CURSOR_VISIBILITY, v); 100 102 } 101 103 102 104 static void curs_goto(int row, int col) 103 105 { 104 nsend_call_2(fb_info.phone, FB_CURSOR_GOTO, row, col);106 async_msg_2(fb_info.phone, FB_CURSOR_GOTO, row, col); 105 107 106 108 } … … 108 110 static void set_style(style_t *style) 109 111 { 110 nsend_call_2(fb_info.phone, FB_SET_STYLE, style->fg_color, style->bg_color);112 async_msg_2(fb_info.phone, FB_SET_STYLE, style->fg_color, style->bg_color); 111 113 } 112 114 113 115 static void set_style_col(int fgcolor, int bgcolor) 114 116 { 115 nsend_call_2(fb_info.phone, FB_SET_STYLE, fgcolor, bgcolor);117 async_msg_2(fb_info.phone, FB_SET_STYLE, fgcolor, bgcolor); 116 118 } 117 119 118 120 static void prtchr(char c, int row, int col) 119 121 { 120 nsend_call_3(fb_info.phone, FB_PUTCHAR, c, row, col);122 async_msg_3(fb_info.phone, FB_PUTCHAR, c, row, col); 121 123 122 124 } … … 166 168 screenbuffer_clear_line(scr, scr->top_line++); 167 169 if (console == active_console) 168 nsend_call(fb_info.phone, FB_SCROLL, 1);170 async_msg(fb_info.phone, FB_SCROLL, 1); 169 171 } 170 172 … … 186 188 187 189 /* Save screen */ 188 newpmap = sync_send(fb_info.phone, FB_VP2PIXMAP, 0, NULL);190 newpmap = async_req(fb_info.phone, FB_VP2PIXMAP, 0, NULL); 189 191 if (newpmap < 0) 190 192 return -1; … … 192 194 if (oldpixmap != -1) { 193 195 /* Show old screen */ 194 nsend_call_2(fb_info.phone, FB_VP_DRAW_PIXMAP, 0, oldpixmap);196 async_msg_2(fb_info.phone, FB_VP_DRAW_PIXMAP, 0, oldpixmap); 195 197 /* Drop old pixmap */ 196 nsend_call(fb_info.phone, FB_DROP_PIXMAP, oldpixmap);198 async_msg(fb_info.phone, FB_DROP_PIXMAP, oldpixmap); 197 199 } 198 200 … … 237 239 console_pixmap = -1; 238 240 } 239 240 241 active_console = newcons; 241 242 gcons_change_console(newcons); … … 245 246 curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x); 246 247 curs_visibility(0); 247 248 248 if (interbuffer) { 249 249 for (i = 0; i < conn->screenbuffer.size_x; i++) … … 251 251 interbuffer[i + j*conn->screenbuffer.size_x] = *get_field_at(&(conn->screenbuffer),i, j); 252 252 /* This call can preempt, but we are already at the end */ 253 j = sync_send_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL, NULL);253 j = async_req_2(fb_info.phone, FB_DRAW_TEXT_DATA, 0, 0, NULL, NULL); 254 254 }; 255 255 … … 302 302 // if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) { 303 303 if ((c >= 0x101) && (c < 0x101 + CONSOLE_COUNT)) { 304 async_serialize_start(); 304 305 if (c == 0x112) 305 306 change_console(KERNEL_CONSOLE); 306 307 else 307 308 change_console(c - 0x101); 309 async_serialize_end(); 308 310 break; 309 311 } … … 322 324 default: 323 325 retval = ENOENT; 324 } 326 } 325 327 ipc_answer_fast(callid, retval, 0, 0); 326 328 } … … 341 343 } 342 344 conn = &connections[consnum]; 343 345 conn->used = 1; 346 347 async_serialize_start(); 344 348 gcons_notify_connect(consnum); 345 conn->used = 1;346 349 conn->client_phone = IPC_GET_ARG3(call); 347 350 screenbuffer_clear(&conn->screenbuffer); … … 349 352 /* Accept the connection */ 350 353 ipc_answer_fast(iid,0,0,0); 351 354 352 355 while (1) { 356 async_serialize_end(); 353 357 callid = async_get_call(&call); 358 async_serialize_start(); 359 354 360 arg1 = arg2 = 0; 355 361 switch (IPC_GET_METHOD(call)) { 356 362 case IPC_M_PHONE_HUNGUP: 357 363 gcons_notify_disconnect(consnum); 364 358 365 /* Answer all pending requests */ 359 366 while (conn->keyrequest_counter > 0) { … … 365 372 /* Commit hangup */ 366 373 ipc_answer_fast(callid, 0,0,0); 374 async_serialize_end(); 367 375 return; 368 376 case CONSOLE_PUTCHAR: … … 373 381 /* Send message to fb */ 374 382 if (consnum == active_console) { 375 send_call(fb_info.phone, FB_CLEAR, 0);383 async_msg(fb_info.phone, FB_CLEAR, 0); 376 384 } 377 385 … … 392 400 break; 393 401 case CONSOLE_FLUSH: 394 sync_send_2(fb_info.phone, FB_FLUSH, 0, 0, NULL, NULL);402 async_req_2(fb_info.phone, FB_FLUSH, 0, 0, NULL, NULL); 395 403 break; 396 404 case CONSOLE_SET_STYLE: … … 460 468 gcons_init(fb_info.phone); 461 469 /* Synchronize, the gcons can have something in queue */ 462 sync_send(fb_info.phone, FB_FLUSH, 0, NULL);470 async_req(fb_info.phone, FB_FLUSH, 0, NULL); 463 471 464 472
Note:
See TracChangeset
for help on using the changeset viewer.