Changes in kernel/genarch/src/drivers/ega/ega.c [b366a6f4:c263c77] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/drivers/ega/ega.c
rb366a6f4 rc263c77 64 64 IRQ_SPINLOCK_DECLARE(lock); 65 65 66 parea_t parea;67 68 66 uint32_t cursor; 69 67 uint8_t *addr; … … 72 70 } ega_instance_t; 73 71 74 static void ega_putchar(outdev_t *, wchar_t );72 static void ega_putchar(outdev_t *, wchar_t, bool); 75 73 static void ega_redraw(outdev_t *); 76 74 … … 439 437 * This function takes care of scrolling. 440 438 */ 441 static void ega_check_cursor(ega_instance_t *instance )439 static void ega_check_cursor(ega_instance_t *instance, bool silent) 442 440 { 443 441 if (instance->cursor < EGA_SCREEN) … … 450 448 EGA_COLS, EMPTY_CHAR); 451 449 452 if ( (!instance->parea.mapped) || (console_override)) {450 if (!silent) { 453 451 memmove((void *) instance->addr, 454 452 (void *) (instance->addr + EGA_COLS * 2), … … 461 459 } 462 460 463 static void ega_show_cursor(ega_instance_t *instance )464 { 465 if ( (!instance->parea.mapped) || (console_override)) {461 static void ega_show_cursor(ega_instance_t *instance, bool silent) 462 { 463 if (!silent) { 466 464 pio_write_8(instance->base + EGA_INDEX_REG, 0x0a); 467 465 uint8_t stat = pio_read_8(instance->base + EGA_DATA_REG); … … 471 469 } 472 470 473 static void ega_move_cursor(ega_instance_t *instance )474 { 475 if ( (!instance->parea.mapped) || (console_override)) {471 static void ega_move_cursor(ega_instance_t *instance, bool silent) 472 { 473 if (!silent) { 476 474 pio_write_8(instance->base + EGA_INDEX_REG, 0x0e); 477 475 pio_write_8(instance->base + EGA_DATA_REG, … … 483 481 } 484 482 485 static void ega_sync_cursor(ega_instance_t *instance )486 { 487 if ( (!instance->parea.mapped) || (console_override)) {483 static void ega_sync_cursor(ega_instance_t *instance, bool silent) 484 { 485 if (!silent) { 488 486 pio_write_8(instance->base + EGA_INDEX_REG, 0x0e); 489 487 uint8_t hi = pio_read_8(instance->base + EGA_DATA_REG); … … 505 503 EGA_SCREEN - instance->cursor, EMPTY_CHAR); 506 504 507 if ( (!instance->parea.mapped) || (console_override))505 if (!silent) 508 506 memsetw(instance->addr + instance->cursor * 2, 509 507 EGA_SCREEN - instance->cursor, EMPTY_CHAR); 510 508 511 ega_check_cursor(instance );512 ega_move_cursor(instance );513 ega_show_cursor(instance );514 } 515 516 static void ega_display_char(ega_instance_t *instance, wchar_t ch )509 ega_check_cursor(instance, silent); 510 ega_move_cursor(instance, silent); 511 ega_show_cursor(instance, silent); 512 } 513 514 static void ega_display_char(ega_instance_t *instance, wchar_t ch, bool silent) 517 515 { 518 516 uint16_t index = ega_oem_glyph(ch); … … 531 529 instance->backbuf[instance->cursor * 2 + 1] = style; 532 530 533 if ( (!instance->parea.mapped) || (console_override)) {531 if (!silent) { 534 532 instance->addr[instance->cursor * 2] = glyph; 535 533 instance->addr[instance->cursor * 2 + 1] = style; … … 537 535 } 538 536 539 static void ega_putchar(outdev_t *dev, wchar_t ch )537 static void ega_putchar(outdev_t *dev, wchar_t ch, bool silent) 540 538 { 541 539 ega_instance_t *instance = (ega_instance_t *) dev->data; … … 557 555 break; 558 556 default: 559 ega_display_char(instance, ch );557 ega_display_char(instance, ch, silent); 560 558 instance->cursor++; 561 559 break; 562 560 } 563 ega_check_cursor(instance );564 ega_move_cursor(instance );561 ega_check_cursor(instance, silent); 562 ega_move_cursor(instance, silent); 565 563 566 564 irq_spinlock_unlock(&instance->lock, true); … … 574 572 575 573 memcpy(instance->addr, instance->backbuf, EGA_VRAM_SIZE); 576 ega_move_cursor(instance );577 ega_show_cursor(instance );574 ega_move_cursor(instance, silent); 575 ega_show_cursor(instance, silent); 578 576 579 577 irq_spinlock_unlock(&instance->lock, true); … … 614 612 } 615 613 616 link_initialize(&instance->parea.link);617 instance->parea.pbase = addr;618 instance->parea.frames = SIZE2FRAMES(EGA_VRAM_SIZE);619 instance->parea.unpriv = false;620 instance->parea.mapped = false;621 ddi_parea_register(&instance->parea);622 623 614 /* Synchronize the back buffer and cursor position. */ 624 615 memcpy(instance->backbuf, instance->addr, EGA_VRAM_SIZE); 625 ega_sync_cursor(instance );616 ega_sync_cursor(instance, silent); 626 617 627 618 if (!fb_exported) { 628 619 /* 629 * We export the kernel framebuffer for uspace usage. 630 * This is used in the case the uspace framebuffer 631 * driver is not self-sufficient. 620 * This is the necessary evil until the userspace driver is entirely 621 * self-sufficient. 632 622 */ 633 623 sysinfo_set_item_val("fb", NULL, true);
Note:
See TracChangeset
for help on using the changeset viewer.