Rev 586 | Rev 669 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 586 | Rev 664 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | 28 | ||
29 | #include <arch/console.h> |
29 | #include <arch/console.h> |
30 | #include <genarch/ofw/ofw.h> |
30 | #include <genarch/ofw/ofw.h> |
31 | #include <console/chardev.h> |
31 | #include <console/chardev.h> |
32 | #include <console/console.h> |
32 | #include <console/console.h> |
- | 33 | #include <arch/asm.h> |
|
- | 34 | #include <arch/register.h> |
|
33 | 35 | ||
34 | static void ofw_sparc64_putchar(chardev_t *d, const char ch); |
36 | static void ofw_sparc64_putchar(chardev_t *d, const char ch); |
35 | 37 | ||
36 | static chardev_t ofw_sparc64_console; |
38 | static chardev_t ofw_sparc64_console; |
37 | static chardev_operations_t ofw_sparc64_console_ops = { |
39 | static chardev_operations_t ofw_sparc64_console_ops = { |
Line 48... | Line 50... | ||
48 | * |
50 | * |
49 | * @param ch Character to be printed. |
51 | * @param ch Character to be printed. |
50 | */ |
52 | */ |
51 | void ofw_sparc64_putchar(chardev_t *d, const char ch) |
53 | void ofw_sparc64_putchar(chardev_t *d, const char ch) |
52 | { |
54 | { |
- | 55 | pstate_reg_t pstate; |
|
- | 56 | ||
- | 57 | /* |
|
- | 58 | * 32-bit OpenFirmware depends on PSTATE.AM bit set. |
|
- | 59 | */ |
|
- | 60 | pstate.value = pstate_read(); |
|
- | 61 | pstate.am = true; |
|
- | 62 | pstate_write(pstate.value); |
|
- | 63 | ||
53 | if (ch == '\n') |
64 | if (ch == '\n') |
54 | ofw_putchar('\r'); |
65 | ofw_putchar('\r'); |
55 | ofw_putchar(ch); |
66 | ofw_putchar(ch); |
- | 67 | ||
- | 68 | pstate.am = false; |
|
- | 69 | pstate_write(pstate.value); |
|
56 | } |
70 | } |