Changes in kernel/generic/src/console/chardev.c [da1bafb:b9c7425] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/chardev.c
rda1bafb rb9c7425 47 47 * 48 48 */ 49 void indev_initialize(c onst char *name, indev_t *indev,49 void indev_initialize(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 irq_spinlock_initialize(&indev->lock, "chardev.indev.lock");54 spinlock_initialize(&indev->lock, "indev"); 55 55 indev->counter = 0; 56 56 indev->index = 0; … … 68 68 ASSERT(indev); 69 69 70 irq_spinlock_lock(&indev->lock, true);70 spinlock_lock(&indev->lock); 71 71 if (indev->counter == INDEV_BUFLEN - 1) { 72 72 /* Buffer full */ 73 irq_spinlock_unlock(&indev->lock, true);73 spinlock_unlock(&indev->lock); 74 74 return; 75 75 } … … 81 81 indev->index = indev->index % INDEV_BUFLEN; 82 82 waitq_wakeup(&indev->wq, WAKEUP_FIRST); 83 irq_spinlock_unlock(&indev->lock, true);83 spinlock_unlock(&indev->lock); 84 84 } 85 85 … … 114 114 115 115 waitq_sleep(&indev->wq); 116 irq_spinlock_lock(&indev->lock, true); 116 ipl_t ipl = interrupts_disable(); 117 spinlock_lock(&indev->lock); 117 118 wchar_t ch = indev->buffer[(indev->index - indev->counter) % INDEV_BUFLEN]; 118 119 indev->counter--; 119 irq_spinlock_unlock(&indev->lock, true); 120 spinlock_unlock(&indev->lock); 121 interrupts_restore(ipl); 120 122 121 123 return ch; … … 128 130 * 129 131 */ 130 void outdev_initialize(c onst char *name, outdev_t *outdev,132 void outdev_initialize(char *name, outdev_t *outdev, 131 133 outdev_operations_t *op) 132 134 { 133 135 outdev->name = name; 134 spinlock_initialize(&outdev->lock, " chardev.outdev.lock");136 spinlock_initialize(&outdev->lock, "outdev"); 135 137 link_initialize(&outdev->link); 136 138 list_initialize(&outdev->list);
Note:
See TracChangeset
for help on using the changeset viewer.