Changeset 0cc4313 in mainline for uspace/srv/console/gcons.c
- Timestamp:
- 2007-11-22T15:50:24Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d40a8ff
- Parents:
- 8498915
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/console/gcons.c
r8498915 r0cc4313 82 82 static void vp_switch(int vp) 83 83 { 84 async_msg (fbphone,FB_VIEWPORT_SWITCH, vp);84 async_msg_1(fbphone,FB_VIEWPORT_SWITCH, vp); 85 85 } 86 86 87 87 /** Create view port */ 88 static int vp_create(unsigned int x, unsigned int y, 89 unsigned int width,unsigned int height)90 { 91 return async_req_2 (fbphone, FB_VIEWPORT_CREATE,92 (x << 16) | y, (width << 16) | height, NULL, NULL);88 static int vp_create(unsigned int x, unsigned int y, unsigned int width, 89 unsigned int height) 90 { 91 return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y, 92 (width << 16) | height); 93 93 } 94 94 95 95 static void clear(void) 96 96 { 97 async_msg (fbphone, FB_CLEAR, 0);97 async_msg_0(fbphone, FB_CLEAR); 98 98 } 99 99 … … 119 119 if (ic_pixmaps[state] != -1) 120 120 async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], 121 121 ic_pixmaps[state]); 122 122 123 123 if (state != CONS_DISCONNECTED && state != CONS_KERNEL && … … 141 141 redraw_state(i); 142 142 if (animation != -1) 143 async_msg (fbphone, FB_ANIM_START, animation);143 async_msg_1(fbphone, FB_ANIM_START, animation); 144 144 } else { 145 145 if (console_state[active_console] == CONS_DISCONNECTED_SEL) … … 225 225 226 226 if (animation != -1) 227 async_msg (fbphone, FB_ANIM_STOP, animation);227 async_msg_1(fbphone, FB_ANIM_STOP, animation); 228 228 229 229 active_console = KERNEL_CONSOLE; /* Set to kernel console */ … … 317 317 /* Create area */ 318 318 shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | 319 319 MAP_ANONYMOUS, 0, 0); 320 320 if (shm == MAP_FAILED) 321 321 return; … … 323 323 memcpy(shm, logo, size); 324 324 /* Send area */ 325 rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm, 0, NULL, 326 NULL); 325 rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); 327 326 if (rc) 328 327 goto exit; 329 rc = async_req_3 (fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0,330 PROTO_READ, NULL, NULL, NULL);328 rc = async_req_3_0(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0, 329 PROTO_READ); 331 330 if (rc) 332 331 goto drop; … … 335 334 drop: 336 335 /* Drop area */ 337 async_msg (fbphone, FB_DROP_SHM, 0);336 async_msg_0(fbphone, FB_DROP_SHM); 338 337 exit: 339 338 /* Remove area */ … … 357 356 clear(); 358 357 draw_pixmap(_binary_helenos_ppm_start, 359 358 (size_t) &_binary_helenos_ppm_size, xres - 66, 2); 360 359 draw_pixmap(_binary_nameic_ppm_start, 361 362 363 for (i = 0; i < CONSOLE_COUNT; i++)360 (size_t) &_binary_nameic_ppm_size, 5, 17); 361 362 for (i = 0; i < CONSOLE_COUNT; i++) 364 363 redraw_state(i); 365 364 vp_switch(console_vp); … … 380 379 /* Create area */ 381 380 shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | 382 381 MAP_ANONYMOUS, 0, 0); 383 382 if (shm == MAP_FAILED) 384 383 return -1; … … 386 385 memcpy(shm, data, size); 387 386 /* Send area */ 388 rc = async_req_2(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm, 0, NULL, 389 NULL); 387 rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); 390 388 if (rc) 391 389 goto exit; 392 rc = async_req_3 (fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0,393 PROTO_READ, NULL, NULL, NULL);390 rc = async_req_3_0(fbphone, IPC_M_AS_AREA_SEND, (ipcarg_t) shm, 0, 391 PROTO_READ); 394 392 if (rc) 395 393 goto drop; 396 394 397 395 /* Obtain pixmap */ 398 rc = async_req (fbphone, FB_SHM2PIXMAP, 0, NULL);396 rc = async_req_0_0(fbphone, FB_SHM2PIXMAP); 399 397 if (rc < 0) 400 398 goto drop; … … 402 400 drop: 403 401 /* Drop area */ 404 async_msg (fbphone, FB_DROP_SHM, 0);402 async_msg_0(fbphone, FB_DROP_SHM); 405 403 exit: 406 404 /* Remove area */ … … 424 422 int pm; 425 423 426 an = async_req(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE], 427 NULL); 424 an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); 428 425 if (an < 0) 429 426 return; 430 427 431 428 pm = make_pixmap(_binary_anim_1_ppm_start, 432 429 (int) &_binary_anim_1_ppm_size); 433 430 async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); 434 431 435 432 pm = make_pixmap(_binary_anim_2_ppm_start, 436 433 (int) &_binary_anim_2_ppm_size); 437 434 async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); 438 435 439 436 pm = make_pixmap(_binary_anim_3_ppm_start, 440 437 (int) &_binary_anim_3_ppm_size); 441 438 async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); 442 439 443 440 pm = make_pixmap(_binary_anim_4_ppm_start, 444 441 (int) &_binary_anim_4_ppm_size); 445 442 async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); 446 443 447 async_msg (fbphone, FB_ANIM_START, an);444 async_msg_1(fbphone, FB_ANIM_START, an); 448 445 449 446 animation = an; … … 468 465 fbphone = phone; 469 466 470 rc = async_req_ 2(phone, FB_GET_RESOLUTION, 0, 0, &xres, &yres);467 rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres); 471 468 if (rc) 472 469 return; … … 478 475 /* Align width & height to character size */ 479 476 console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP, 480 481 477 ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8), 478 ALIGN_DOWN(yres - (CONSOLE_TOP + CONSOLE_MARGIN), 16)); 482 479 if (console_vp < 0) 483 480 return; … … 487 484 for (i = 0; i < CONSOLE_COUNT; i++) { 488 485 cstatus_vp[i] = vp_create(status_start + CONSOLE_MARGIN + 489 490 486 i * (STATUS_WIDTH + STATUS_SPACE), STATUS_TOP, 487 STATUS_WIDTH, STATUS_HEIGHT); 491 488 if (cstatus_vp[i] < 0) 492 489 return; … … 497 494 /* Initialize icons */ 498 495 ic_pixmaps[CONS_SELECTED] = 499 500 496 make_pixmap(_binary_cons_selected_ppm_start, 497 (int) &_binary_cons_selected_ppm_size); 501 498 ic_pixmaps[CONS_IDLE] = make_pixmap(_binary_cons_idle_ppm_start, 502 499 (int) &_binary_cons_idle_ppm_size); 503 500 ic_pixmaps[CONS_HAS_DATA] = 504 505 501 make_pixmap(_binary_cons_has_data_ppm_start, 502 (int) &_binary_cons_has_data_ppm_size); 506 503 ic_pixmaps[CONS_DISCONNECTED] = 507 508 504 make_pixmap(_binary_cons_idle_ppm_start, 505 (int) &_binary_cons_idle_ppm_size); 509 506 ic_pixmaps[CONS_KERNEL] = make_pixmap(_binary_cons_kernel_ppm_start, 510 507 (int) &_binary_cons_kernel_ppm_size); 511 508 ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED]; 512 509
Note:
See TracChangeset
for help on using the changeset viewer.