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

Changeset c263c77 in mainline


Ignore:
Timestamp:
2011-05-20T23:12:26Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
0c33b1d5
Parents:
b6f3e7e
Message:

revert poisonous part of changeset mainline,971
(sadly, this reopens #243)

Location:
kernel
Files:
3 edited

Legend:

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

    rb6f3e7e rc263c77  
    4040#include <mm/as.h>
    4141#include <mm/slab.h>
    42 #include <synch/mutex.h>
    4342#include <arch/mm/page.h>
    4443#include <typedefs.h>
     
    6362
    6463typedef struct {
    65         mutex_t mtx;
     64        IRQ_SPINLOCK_DECLARE(lock);
    6665       
    6766        uint32_t cursor;
     
    540539        ega_instance_t *instance = (ega_instance_t *) dev->data;
    541540       
    542         mutex_lock(&instance->mtx);
     541        irq_spinlock_lock(&instance->lock, true);
    543542       
    544543        switch (ch) {
     
    563562        ega_move_cursor(instance, silent);
    564563       
    565         mutex_unlock(&instance->mtx);
     564        irq_spinlock_unlock(&instance->lock, true);
    566565}
    567566
     
    570569        ega_instance_t *instance = (ega_instance_t *) dev->data;
    571570       
    572         mutex_lock(&instance->mtx);
     571        irq_spinlock_lock(&instance->lock, true);
    573572       
    574573        memcpy(instance->addr, instance->backbuf, EGA_VRAM_SIZE);
     
    576575        ega_show_cursor(instance, silent);
    577576       
    578         mutex_unlock(&instance->mtx);
     577        irq_spinlock_unlock(&instance->lock, true);
    579578}
    580579
     
    594593        egadev->data = instance;
    595594       
    596         mutex_initialize(&instance->mtx, MUTEX_PASSIVE);
     595        irq_spinlock_initialize(&instance->lock, "*ega.instance.lock");
    597596       
    598597        instance->base = base;
  • kernel/genarch/src/fb/fb.c

    rb6f3e7e rc263c77  
    8080
    8181typedef struct {
    82         mutex_t mtx;
     82        SPINLOCK_DECLARE(lock);
    8383       
    8484        uint8_t *addr;
     
    365365{
    366366        fb_instance_t *instance = (fb_instance_t *) dev->data;
    367         mutex_lock(&instance->mtx);
     367        spinlock_lock(&instance->lock);
    368368       
    369369        switch (ch) {
     
    406406        cursor_put(instance, silent);
    407407       
    408         mutex_unlock(&instance->mtx);
     408        spinlock_unlock(&instance->lock);
    409409}
    410410
     
    473473        fb_instance_t *instance = (fb_instance_t *) dev->data;
    474474       
    475         mutex_lock(&instance->mtx);
     475        spinlock_lock(&instance->lock);
    476476        fb_redraw_internal(instance);
    477         mutex_unlock(&instance->mtx);
     477        spinlock_unlock(&instance->lock);
    478478}
    479479
     
    554554        fbdev->data = instance;
    555555       
    556         mutex_initialize(&instance->mtx, MUTEX_PASSIVE);
     556        spinlock_initialize(&instance->lock, "*fb.instance.lock");
    557557        instance->rgb_conv = rgb_conv;
    558558        instance->pixelbytes = pixelbytes;
  • kernel/generic/src/synch/spinlock.c

    rb6f3e7e rc263c77  
    8484                 * This conserns especially printf_lock and the
    8585                 * framebuffer lock.
     86                 *
     87                 * Any lock whose name is prefixed by "*" will be
     88                 * ignored by this deadlock detection routine
     89                 * as this might cause an infinite recursion.
     90                 * We trust our code that there is no possible deadlock
     91                 * caused by these locks (except when an exception
     92                 * is triggered for instance by printf()).
     93                 *
     94                 * We encountered false positives caused by very
     95                 * slow framebuffer interaction (especially when
     96                 * run in a simulator) that caused problems with both
     97                 * printf_lock and the framebuffer lock.
    8698                 */
     99                if (lock->name[0] == '*')
     100                        continue;
     101               
    87102                if (i++ > DEADLOCK_THRESHOLD) {
    88103                        printf("cpu%u: looping on spinlock %p:%s, "
Note: See TracChangeset for help on using the changeset viewer.