Changeset 8565a42 in mainline for kernel/generic/src/console/chardev.c
- Timestamp:
- 2018-03-02T20:34:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1a81f69, d5e5fd1
- Parents:
- 3061bc1 (diff), 34e1206 (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. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
- git-committer:
- GitHub <noreply@…> (2018-03-02 20:34:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/chardev.c
r3061bc1 r8565a42 68 68 { 69 69 assert(indev); 70 70 71 71 irq_spinlock_lock(&indev->lock, true); 72 72 if (indev->counter == INDEV_BUFLEN - 1) { … … 75 75 return; 76 76 } 77 77 78 78 indev->counter++; 79 79 indev->buffer[indev->index++] = ch; 80 80 81 81 /* Index modulo size of buffer */ 82 82 indev->index = indev->index % INDEV_BUFLEN; … … 102 102 if (check_poll(indev)) 103 103 return indev->op->poll(indev); 104 104 105 105 /* No other way of interacting with user */ 106 106 interrupts_disable(); 107 107 108 108 if (CPU) 109 109 printf("cpu%u: ", CPU->id); 110 110 else 111 111 printf("cpu: "); 112 112 113 113 printf("halted (no polling input)\n"); 114 114 cpu_halt(); 115 115 } 116 116 117 117 waitq_sleep(&indev->wq); 118 118 irq_spinlock_lock(&indev->lock, true); … … 121 121 indev->counter--; 122 122 irq_spinlock_unlock(&indev->lock, true); 123 123 124 124 return ch; 125 125 } … … 158 158 if (indev == NULL) 159 159 return false; 160 160 161 161 if (indev->op == NULL) 162 162 return false; 163 163 164 164 return (indev->op->poll != NULL); 165 165 }
Note:
See TracChangeset
for help on using the changeset viewer.