diff options
Diffstat (limited to 'arch/tile/kernel')
| -rw-r--r-- | arch/tile/kernel/early_printk.c | 47 | ||||
| -rw-r--r-- | arch/tile/kernel/hvglue.lds | 3 | ||||
| -rw-r--r-- | arch/tile/kernel/reboot.c | 2 |
3 files changed, 13 insertions, 39 deletions
diff --git a/arch/tile/kernel/early_printk.c b/arch/tile/kernel/early_printk.c index 34d72a151bf3..b608e00e7f6d 100644 --- a/arch/tile/kernel/early_printk.c +++ b/arch/tile/kernel/early_printk.c | |||
| @@ -23,19 +23,24 @@ | |||
| 23 | 23 | ||
| 24 | static void early_hv_write(struct console *con, const char *s, unsigned n) | 24 | static void early_hv_write(struct console *con, const char *s, unsigned n) |
| 25 | { | 25 | { |
| 26 | hv_console_write((HV_VirtAddr) s, n); | 26 | tile_console_write(s, n); |
| 27 | |||
| 28 | /* | ||
| 29 | * Convert NL to NLCR (close enough to CRNL) during early boot. | ||
| 30 | * We assume newlines are at the ends of strings, which turns out | ||
| 31 | * to be good enough for early boot console output. | ||
| 32 | */ | ||
| 33 | if (n && s[n-1] == '\n') | ||
| 34 | tile_console_write("\r", 1); | ||
| 27 | } | 35 | } |
| 28 | 36 | ||
| 29 | static struct console early_hv_console = { | 37 | static struct console early_hv_console = { |
| 30 | .name = "earlyhv", | 38 | .name = "earlyhv", |
| 31 | .write = early_hv_write, | 39 | .write = early_hv_write, |
| 32 | .flags = CON_PRINTBUFFER, | 40 | .flags = CON_PRINTBUFFER | CON_BOOT, |
| 33 | .index = -1, | 41 | .index = -1, |
| 34 | }; | 42 | }; |
| 35 | 43 | ||
| 36 | /* Direct interface for emergencies */ | ||
| 37 | static int early_console_complete; | ||
| 38 | |||
| 39 | void early_panic(const char *fmt, ...) | 44 | void early_panic(const char *fmt, ...) |
| 40 | { | 45 | { |
| 41 | va_list ap; | 46 | va_list ap; |
| @@ -43,51 +48,21 @@ void early_panic(const char *fmt, ...) | |||
| 43 | va_start(ap, fmt); | 48 | va_start(ap, fmt); |
| 44 | early_printk("Kernel panic - not syncing: "); | 49 | early_printk("Kernel panic - not syncing: "); |
| 45 | early_vprintk(fmt, ap); | 50 | early_vprintk(fmt, ap); |
| 46 | early_console->write(early_console, "\n", 1); | 51 | early_printk("\n"); |
| 47 | va_end(ap); | 52 | va_end(ap); |
| 48 | dump_stack(); | 53 | dump_stack(); |
| 49 | hv_halt(); | 54 | hv_halt(); |
| 50 | } | 55 | } |
| 51 | 56 | ||
| 52 | static int __initdata keep_early; | ||
| 53 | |||
| 54 | static int __init setup_early_printk(char *str) | 57 | static int __init setup_early_printk(char *str) |
| 55 | { | 58 | { |
| 56 | if (early_console) | 59 | if (early_console) |
| 57 | return 1; | 60 | return 1; |
| 58 | 61 | ||
| 59 | if (str != NULL && strncmp(str, "keep", 4) == 0) | ||
| 60 | keep_early = 1; | ||
| 61 | |||
| 62 | early_console = &early_hv_console; | 62 | early_console = &early_hv_console; |
| 63 | register_console(early_console); | 63 | register_console(early_console); |
| 64 | 64 | ||
| 65 | return 0; | 65 | return 0; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | void __init disable_early_printk(void) | ||
| 69 | { | ||
| 70 | early_console_complete = 1; | ||
| 71 | if (!early_console) | ||
| 72 | return; | ||
| 73 | if (!keep_early) { | ||
| 74 | early_printk("disabling early console\n"); | ||
| 75 | unregister_console(early_console); | ||
| 76 | early_console = NULL; | ||
| 77 | } else { | ||
| 78 | early_printk("keeping early console\n"); | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | void warn_early_printk(void) | ||
| 83 | { | ||
| 84 | if (early_console_complete || early_console) | ||
| 85 | return; | ||
| 86 | early_printk("\ | ||
| 87 | Machine shutting down before console output is fully initialized.\n\ | ||
| 88 | You may wish to reboot and add the option 'earlyprintk' to your\n\ | ||
| 89 | boot command line to see any diagnostic early console output.\n\ | ||
| 90 | "); | ||
| 91 | } | ||
| 92 | |||
| 93 | early_param("earlyprintk", setup_early_printk); | 68 | early_param("earlyprintk", setup_early_printk); |
diff --git a/arch/tile/kernel/hvglue.lds b/arch/tile/kernel/hvglue.lds index d44c5a67a1ed..ef522900633a 100644 --- a/arch/tile/kernel/hvglue.lds +++ b/arch/tile/kernel/hvglue.lds | |||
| @@ -56,4 +56,5 @@ hv_inquire_realpa = TEXT_OFFSET + 0x106c0; | |||
| 56 | hv_flush_all = TEXT_OFFSET + 0x106e0; | 56 | hv_flush_all = TEXT_OFFSET + 0x106e0; |
| 57 | hv_get_ipi_pte = TEXT_OFFSET + 0x10700; | 57 | hv_get_ipi_pte = TEXT_OFFSET + 0x10700; |
| 58 | hv_set_pte_super_shift = TEXT_OFFSET + 0x10720; | 58 | hv_set_pte_super_shift = TEXT_OFFSET + 0x10720; |
| 59 | hv_glue_internals = TEXT_OFFSET + 0x10740; | 59 | hv_console_set_ipi = TEXT_OFFSET + 0x107e0; |
| 60 | hv_glue_internals = TEXT_OFFSET + 0x10800; | ||
diff --git a/arch/tile/kernel/reboot.c b/arch/tile/kernel/reboot.c index d1b5c913ae72..6c5d2c070a12 100644 --- a/arch/tile/kernel/reboot.c +++ b/arch/tile/kernel/reboot.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | 27 | ||
| 28 | void machine_halt(void) | 28 | void machine_halt(void) |
| 29 | { | 29 | { |
| 30 | warn_early_printk(); | ||
| 31 | arch_local_irq_disable_all(); | 30 | arch_local_irq_disable_all(); |
| 32 | smp_send_stop(); | 31 | smp_send_stop(); |
| 33 | hv_halt(); | 32 | hv_halt(); |
| @@ -35,7 +34,6 @@ void machine_halt(void) | |||
| 35 | 34 | ||
| 36 | void machine_power_off(void) | 35 | void machine_power_off(void) |
| 37 | { | 36 | { |
| 38 | warn_early_printk(); | ||
| 39 | arch_local_irq_disable_all(); | 37 | arch_local_irq_disable_all(); |
| 40 | smp_send_stop(); | 38 | smp_send_stop(); |
| 41 | hv_power_off(); | 39 | hv_power_off(); |
