Changeset 04803bf in mainline for kernel/generic/src/console/chardev.c


Ignore:
Timestamp:
2011-03-21T22:00:17Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e
Parents:
b50b5af2 (diff), 7308e84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes (needs fixes).

File:
1 edited

Legend:

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

    rb50b5af2 r04803bf  
    4747 *
    4848 */
    49 void indev_initialize(char *name, indev_t *indev,
     49void indev_initialize(const char *name, indev_t *indev,
    5050    indev_operations_t *op)
    5151{
    5252        indev->name = name;
    5353        waitq_initialize(&indev->wq);
    54         spinlock_initialize(&indev->lock, "indev");
     54        irq_spinlock_initialize(&indev->lock, "chardev.indev.lock");
    5555        indev->counter = 0;
    5656        indev->index = 0;
     
    6868        ASSERT(indev);
    6969       
    70         spinlock_lock(&indev->lock);
     70        irq_spinlock_lock(&indev->lock, true);
    7171        if (indev->counter == INDEV_BUFLEN - 1) {
    7272                /* Buffer full */
    73                 spinlock_unlock(&indev->lock);
     73                irq_spinlock_unlock(&indev->lock, true);
    7474                return;
    7575        }
     
    8181        indev->index = indev->index % INDEV_BUFLEN;
    8282        waitq_wakeup(&indev->wq, WAKEUP_FIRST);
    83         spinlock_unlock(&indev->lock);
     83        irq_spinlock_unlock(&indev->lock, true);
    8484}
    8585
     
    114114       
    115115        waitq_sleep(&indev->wq);
    116         ipl_t ipl = interrupts_disable();
    117         spinlock_lock(&indev->lock);
     116        irq_spinlock_lock(&indev->lock, true);
    118117        wchar_t ch = indev->buffer[(indev->index - indev->counter) % INDEV_BUFLEN];
    119118        indev->counter--;
    120         spinlock_unlock(&indev->lock);
    121         interrupts_restore(ipl);
     119        irq_spinlock_unlock(&indev->lock, true);
    122120       
    123121        return ch;
     
    130128 *
    131129 */
    132 void outdev_initialize(char *name, outdev_t *outdev,
     130void outdev_initialize(const char *name, outdev_t *outdev,
    133131    outdev_operations_t *op)
    134132{
    135133        outdev->name = name;
    136         spinlock_initialize(&outdev->lock, "outdev");
     134        spinlock_initialize(&outdev->lock, "chardev.outdev.lock");
    137135        link_initialize(&outdev->link);
    138136        list_initialize(&outdev->list);
Note: See TracChangeset for help on using the changeset viewer.