Rev 894 | Rev 897 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 894 | Rev 895 | ||
|---|---|---|---|
| Line 29... | Line 29... | ||
| 29 | #include <arch/console.h> |
29 | #include <arch/console.h> |
| 30 | #include <arch/types.h> |
30 | #include <arch/types.h> |
| 31 | #include <typedefs.h> |
31 | #include <typedefs.h> |
| 32 | #include <genarch/fb/fb.h> |
32 | #include <genarch/fb/fb.h> |
| 33 | #include <arch/drivers/fb.h> |
33 | #include <arch/drivers/fb.h> |
| 34 | #include <arch/drivers/keyboard.h> |
34 | #include <arch/drivers/i8042.h> |
| - | 35 | #include <genarch/i8042/i8042.h> |
|
| 35 | #include <genarch/ofw/ofw.h> |
36 | #include <genarch/ofw/ofw.h> |
| 36 | #include <console/chardev.h> |
37 | #include <console/chardev.h> |
| 37 | #include <console/console.h> |
38 | #include <console/console.h> |
| 38 | #include <arch/asm.h> |
39 | #include <arch/asm.h> |
| 39 | #include <arch/register.h> |
40 | #include <arch/register.h> |
| 40 | #include <proc/thread.h> |
41 | #include <proc/thread.h> |
| 41 | #include <synch/mutex.h> |
42 | #include <synch/mutex.h> |
| 42 | 43 | ||
| - | 44 | #define KEYBOARD_POLL_PAUSE 50000 /* 50ms */ |
|
| - | 45 | ||
| 43 | static void ofw_sparc64_putchar(chardev_t *d, const char ch); |
46 | static void ofw_sparc64_putchar(chardev_t *d, const char ch); |
| 44 | static char ofw_sparc64_getchar(chardev_t *d); |
47 | static char ofw_sparc64_getchar(chardev_t *d); |
| 45 | static void ofw_sparc64_suspend(chardev_t *d); |
48 | static void ofw_sparc64_suspend(chardev_t *d); |
| 46 | static void ofw_sparc64_resume(chardev_t *d); |
49 | static void ofw_sparc64_resume(chardev_t *d); |
| 47 | 50 | ||
| Line 71... | Line 74... | ||
| 71 | void standalone_sparc64_console_init(void) |
74 | void standalone_sparc64_console_init(void) |
| 72 | { |
75 | { |
| 73 | ofw_console_active = 0; |
76 | ofw_console_active = 0; |
| 74 | stdin = NULL; |
77 | stdin = NULL; |
| 75 | fb_init(FB_VIRT_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH/8); |
78 | fb_init(FB_VIRT_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH/8); |
| - | 79 | i8042_init(); |
|
| 76 | } |
80 | } |
| 77 | 81 | ||
| 78 | /** Write one character using OpenFirmware. |
82 | /** Write one character using OpenFirmware. |
| 79 | * |
83 | * |
| 80 | * @param d Character device (ignored). |
84 | * @param d Character device (ignored). |
| Line 153... | Line 157... | ||
| 153 | if (ch) { |
157 | if (ch) { |
| 154 | if (ch == '\r') |
158 | if (ch == '\r') |
| 155 | ch = '\n'; |
159 | ch = '\n'; |
| 156 | chardev_push_character(&ofw_sparc64_console, ch); |
160 | chardev_push_character(&ofw_sparc64_console, ch); |
| 157 | } |
161 | } |
| 158 | thread_usleep(25000); |
162 | thread_usleep(KEYBOARD_POLL_PAUSE); |
| - | 163 | } |
|
| - | 164 | } |
|
| - | 165 | ||
| - | 166 | /** Kernel thread for polling keyboard. |
|
| - | 167 | * |
|
| - | 168 | * @param arg Ignored. |
|
| - | 169 | */ |
|
| - | 170 | void kkbdpoll(void *arg) |
|
| - | 171 | { |
|
| - | 172 | while (1) { |
|
| - | 173 | i8042_poll(); |
|
| - | 174 | thread_usleep(KEYBOARD_POLL_PAUSE); |
|
| 159 | } |
175 | } |
| 160 | } |
176 | } |