Changeset c621f4aa in mainline for kernel/generic/src/console/chardev.c
- Timestamp:
- 2010-07-25T10:11:13Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 377cce8
- Parents:
- 24a2517 (diff), a2da43c (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. - File:
-
- 1 edited
-
kernel/generic/src/console/chardev.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/chardev.c
r24a2517 rc621f4aa 47 47 * 48 48 */ 49 void indev_initialize(c har *name, indev_t *indev,49 void indev_initialize(const char *name, indev_t *indev, 50 50 indev_operations_t *op) 51 51 { 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; … … 130 128 * 131 129 */ 132 void outdev_initialize(c har *name, outdev_t *outdev,130 void outdev_initialize(const char *name, outdev_t *outdev, 133 131 outdev_operations_t *op) 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.
