Changeset a35b458 in mainline for kernel/generic/src/console/chardev.c
- Timestamp:
- 2018-03-02T20:10:49Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/chardev.c
r3061bc1 ra35b458 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.