Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/drivers/ega/ega.c

    r28a5ebd rb169619  
    4242#include <typedefs.h>
    4343#include <arch/asm.h>
    44 #include <mem.h>
     44#include <memw.h>
    4545#include <str.h>
    4646#include <console/chardev.h>
     
    568568}
    569569
    570 static void ega_redraw(outdev_t *dev)
    571 {
    572         ega_instance_t *instance = (ega_instance_t *) dev->data;
    573 
    574         irq_spinlock_lock(&instance->lock, true);
    575 
     570static void ega_redraw_internal(ega_instance_t *instance)
     571{
    576572        memcpy(instance->addr, instance->backbuf, EGA_VRAM_SIZE);
    577573        ega_move_cursor(instance);
    578574        ega_show_cursor(instance);
    579 
     575}
     576
     577static void ega_redraw(outdev_t *dev)
     578{
     579        ega_instance_t *instance = (ega_instance_t *) dev->data;
     580
     581        irq_spinlock_lock(&instance->lock, true);
     582        ega_redraw_internal(instance);
    580583        irq_spinlock_unlock(&instance->lock, true);
     584}
     585
     586/** EGA was mapped or unmapped.
     587 *
     588 * @param arg EGA instance
     589 */
     590static void ega_mapped_changed(void *arg)
     591{
     592        ega_instance_t *instance = (ega_instance_t *) arg;
     593
     594        if (!instance->parea.mapped) {
     595                irq_spinlock_lock(&instance->lock, true);
     596                ega_redraw_internal(instance);
     597                irq_spinlock_unlock(&instance->lock, true);
     598        }
    581599}
    582600
     
    621639        instance->parea.unpriv = false;
    622640        instance->parea.mapped = false;
     641        instance->parea.mapped_changed = ega_mapped_changed;
     642        instance->parea.arg = (void *) instance;
    623643        ddi_parea_register(&instance->parea);
    624644
Note: See TracChangeset for help on using the changeset viewer.