Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 712c4ba in mainline for kernel/genarch/src/drivers/ega/ega.c


Ignore:
Timestamp:
2011-05-20T16:09:24Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
b6f3e7e
Parents:
326bf65
Message:

avoid spinlocks to be taken in the direct code path to physically outputing kconsole characters to the framebuffer (this fixes ticket #243)
the spinlock in printf() (kernel) was sacrificed, this might lead potentially to scrambled kconsole output
the hack of ignoring spinlocks whose names start with "*" in the livelock detector can be removed

File:
1 edited

Legend:

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

    r326bf65 r712c4ba  
    4040#include <mm/as.h>
    4141#include <mm/slab.h>
     42#include <synch/mutex.h>
    4243#include <arch/mm/page.h>
    43 #include <synch/spinlock.h>
    4444#include <typedefs.h>
    4545#include <arch/asm.h>
     
    6363
    6464typedef struct {
    65         IRQ_SPINLOCK_DECLARE(lock);
     65        mutex_t mtx;
    6666       
    6767        uint32_t cursor;
     
    540540        ega_instance_t *instance = (ega_instance_t *) dev->data;
    541541       
    542         irq_spinlock_lock(&instance->lock, true);
     542        mutex_lock(&instance->mtx);
    543543       
    544544        switch (ch) {
     
    563563        ega_move_cursor(instance, silent);
    564564       
    565         irq_spinlock_unlock(&instance->lock, true);
     565        mutex_unlock(&instance->mtx);
    566566}
    567567
     
    570570        ega_instance_t *instance = (ega_instance_t *) dev->data;
    571571       
    572         irq_spinlock_lock(&instance->lock, true);
     572        mutex_lock(&instance->mtx);
    573573       
    574574        memcpy(instance->addr, instance->backbuf, EGA_VRAM_SIZE);
     
    576576        ega_show_cursor(instance, silent);
    577577       
    578         irq_spinlock_unlock(&instance->lock, true);
     578        mutex_unlock(&instance->mtx);
    579579}
    580580
     
    594594        egadev->data = instance;
    595595       
    596         irq_spinlock_initialize(&instance->lock, "*ega.instance.lock");
     596        mutex_initialize(&instance->mtx, MUTEX_PASSIVE);
    597597       
    598598        instance->base = base;
Note: See TracChangeset for help on using the changeset viewer.