Changeset da1bafb in mainline for kernel/generic/src/console/chardev.c
- Timestamp:
- 2010-05-24T18:57:31Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0095368
- Parents:
- 666f492
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/chardev.c
r666f492 rda1bafb 52 52 indev->name = name; 53 53 waitq_initialize(&indev->wq); 54 spinlock_initialize(&indev->lock, "indev");54 irq_spinlock_initialize(&indev->lock, "chardev.indev.lock"); 55 55 indev->counter = 0; 56 56 indev->index = 0; … … 68 68 ASSERT(indev); 69 69 70 spinlock_lock(&indev->lock);70 irq_spinlock_lock(&indev->lock, true); 71 71 if (indev->counter == INDEV_BUFLEN - 1) { 72 72 /* Buffer full */ 73 spinlock_unlock(&indev->lock);73 irq_spinlock_unlock(&indev->lock, true); 74 74 return; 75 75 } … … 81 81 indev->index = indev->index % INDEV_BUFLEN; 82 82 waitq_wakeup(&indev->wq, WAKEUP_FIRST); 83 spinlock_unlock(&indev->lock);83 irq_spinlock_unlock(&indev->lock, true); 84 84 } 85 85 … … 114 114 115 115 waitq_sleep(&indev->wq); 116 ipl_t ipl = interrupts_disable(); 117 spinlock_lock(&indev->lock); 116 irq_spinlock_lock(&indev->lock, true); 118 117 wchar_t ch = indev->buffer[(indev->index - indev->counter) % INDEV_BUFLEN]; 119 118 indev->counter--; 120 spinlock_unlock(&indev->lock); 121 interrupts_restore(ipl); 119 irq_spinlock_unlock(&indev->lock, true); 122 120 123 121 return ch; … … 134 132 { 135 133 outdev->name = name; 136 spinlock_initialize(&outdev->lock, " outdev");134 spinlock_initialize(&outdev->lock, "chardev.outdev.lock"); 137 135 link_initialize(&outdev->link); 138 136 list_initialize(&outdev->list);
Note:
See TracChangeset
for help on using the changeset viewer.