Rev 4094 | Rev 4148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4094 | Rev 4119 | ||
|---|---|---|---|
| Line 40... | Line 40... | ||
| 40 | #include <console/chardev.h> |
40 | #include <console/chardev.h> |
| 41 | #include <mm/slab.h> |
41 | #include <mm/slab.h> |
| 42 | 42 | ||
| 43 | #define LSR_DATA_READY 0x01 |
43 | #define LSR_DATA_READY 0x01 |
| 44 | 44 | ||
| 45 | indev_operations_t kbrdin_ops = { |
45 | static indev_operations_t kbrdin_ops = { |
| 46 | .poll = NULL |
46 | .poll = NULL |
| 47 | }; |
47 | }; |
| 48 | 48 | ||
| 49 | static irq_ownership_t ns16550_claim(irq_t *irq) |
49 | static irq_ownership_t ns16550_claim(irq_t *irq) |
| 50 | { |
50 | { |
| Line 62... | Line 62... | ||
| 62 | ns16550_instance_t *instance = irq->instance; |
62 | ns16550_instance_t *instance = irq->instance; |
| 63 | ns16550_t *dev = instance->ns16550; |
63 | ns16550_t *dev = instance->ns16550; |
| 64 | 64 | ||
| 65 | if (pio_read_8(&dev->lsr) & LSR_DATA_READY) { |
65 | if (pio_read_8(&dev->lsr) & LSR_DATA_READY) { |
| 66 | uint8_t x = pio_read_8(&dev->rbr); |
66 | uint8_t x = pio_read_8(&dev->rbr); |
| 67 | chardev_push_character(&instance->kbrdin, x); |
67 | indev_push_character(&instance->kbrdin, x); |
| 68 | } |
68 | } |
| 69 | } |
69 | } |
| 70 | 70 | ||
| 71 | /** Initialize ns16550. |
71 | /** Initialize ns16550. |
| 72 | * |
72 | * |