Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/chardev.c

    rda1bafb ra000878c  
    5252        indev->name = name;
    5353        waitq_initialize(&indev->wq);
    54         irq_spinlock_initialize(&indev->lock, "chardev.indev.lock");
     54        spinlock_initialize(&indev->lock, "indev");
    5555        indev->counter = 0;
    5656        indev->index = 0;
     
    6868        ASSERT(indev);
    6969       
    70         irq_spinlock_lock(&indev->lock, true);
     70        spinlock_lock(&indev->lock);
    7171        if (indev->counter == INDEV_BUFLEN - 1) {
    7272                /* Buffer full */
    73                 irq_spinlock_unlock(&indev->lock, true);
     73                spinlock_unlock(&indev->lock);
    7474                return;
    7575        }
     
    8181        indev->index = indev->index % INDEV_BUFLEN;
    8282        waitq_wakeup(&indev->wq, WAKEUP_FIRST);
    83         irq_spinlock_unlock(&indev->lock, true);
     83        spinlock_unlock(&indev->lock);
    8484}
    8585
     
    114114       
    115115        waitq_sleep(&indev->wq);
    116         irq_spinlock_lock(&indev->lock, true);
     116        ipl_t ipl = interrupts_disable();
     117        spinlock_lock(&indev->lock);
    117118        wchar_t ch = indev->buffer[(indev->index - indev->counter) % INDEV_BUFLEN];
    118119        indev->counter--;
    119         irq_spinlock_unlock(&indev->lock, true);
     120        spinlock_unlock(&indev->lock);
     121        interrupts_restore(ipl);
    120122       
    121123        return ch;
     
    132134{
    133135        outdev->name = name;
    134         spinlock_initialize(&outdev->lock, "chardev.outdev.lock");
     136        spinlock_initialize(&outdev->lock, "outdev");
    135137        link_initialize(&outdev->link);
    136138        list_initialize(&outdev->list);
Note: See TracChangeset for help on using the changeset viewer.