Rev 534 | Rev 588 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 534 | Rev 575 | ||
|---|---|---|---|
| Line 35... | Line 35... | ||
| 35 | #include <typedefs.h> |
35 | #include <typedefs.h> |
| 36 | #include <arch.h> |
36 | #include <arch.h> |
| 37 | 37 | ||
| 38 | /** Standard input character device. */ |
38 | /** Standard input character device. */ |
| 39 | chardev_t *stdin = NULL; |
39 | chardev_t *stdin = NULL; |
| - | 40 | chardev_t *stdout = NULL; |
|
| 40 | 41 | ||
| 41 | /** Get string from character device. |
42 | /** Get string from character device. |
| 42 | * |
43 | * |
| 43 | * Read characters from character device until first occurrence |
44 | * Read characters from character device until first occurrence |
| 44 | * of newline character. |
45 | * of newline character. |
| Line 82... | Line 83... | ||
| 82 | ch = chardev->buffer[(chardev->index - chardev->counter) % CHARDEV_BUFLEN]; |
83 | ch = chardev->buffer[(chardev->index - chardev->counter) % CHARDEV_BUFLEN]; |
| 83 | chardev->counter--; |
84 | chardev->counter--; |
| 84 | spinlock_unlock(&chardev->lock); |
85 | spinlock_unlock(&chardev->lock); |
| 85 | interrupts_restore(ipl); |
86 | interrupts_restore(ipl); |
| 86 | 87 | ||
| 87 | chardev->op->resume(); |
88 | chardev->op->resume(chardev); |
| 88 | 89 | ||
| 89 | return ch; |
90 | return ch; |
| 90 | } |
91 | } |
| - | 92 | ||
| - | 93 | void putchar(char c) |
|
| - | 94 | { |
|
| - | 95 | stdout->op->write(stdout, c); |
|
| - | 96 | } |
|