diff options
author | Matthew Wilcox <willy@parisc-linux.org> | 2005-10-21 22:50:06 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@parisc-linux.org> | 2005-10-21 22:50:06 -0400 |
commit | 7c92e972da0dd5b6a9ddf01030aab7dec9912b1f (patch) | |
tree | bd2d132c35e044e31dcab92915f202265f9d7929 /arch | |
parent | 40c72f20e89300dfaea28300ee17aa56d230d63f (diff) |
[PARISC] Update pdc console from parisc tree
Get rid of some unnecessary includes
Remove a layer of macro indirection around pdc_console_device
Delete pdc_console_die() as it is unused
Avoid double-printing on panic by clearing CON_PRINTBUFFER rather than
setting con_start to be log_end
Make con_start and log_end static again
Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/pdc_cons.c | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 01f676d1673b..215d78c87bc5 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | /* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems. | 42 | /* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems. |
43 | * On production kernels EARLY_BOOTUP_DEBUG should be undefined. */ | 43 | * On production kernels EARLY_BOOTUP_DEBUG should be undefined. */ |
44 | #undef EARLY_BOOTUP_DEBUG | 44 | #define EARLY_BOOTUP_DEBUG |
45 | 45 | ||
46 | 46 | ||
47 | #include <linux/config.h> | 47 | #include <linux/config.h> |
@@ -49,14 +49,8 @@ | |||
49 | #include <linux/console.h> | 49 | #include <linux/console.h> |
50 | #include <linux/string.h> | 50 | #include <linux/string.h> |
51 | #include <linux/init.h> | 51 | #include <linux/init.h> |
52 | #include <linux/delay.h> | ||
53 | #include <linux/sched.h> | ||
54 | #include <linux/interrupt.h> | ||
55 | #include <linux/major.h> | 52 | #include <linux/major.h> |
56 | #include <linux/tty.h> | 53 | #include <linux/tty.h> |
57 | #include <asm/page.h> | ||
58 | #include <asm/types.h> | ||
59 | #include <asm/system.h> | ||
60 | #include <asm/pdc.h> /* for iodc_call() proto and friends */ | 54 | #include <asm/pdc.h> /* for iodc_call() proto and friends */ |
61 | 55 | ||
62 | 56 | ||
@@ -96,7 +90,6 @@ static int pdc_console_setup(struct console *co, char *options) | |||
96 | } | 90 | } |
97 | 91 | ||
98 | #if defined(CONFIG_PDC_CONSOLE) | 92 | #if defined(CONFIG_PDC_CONSOLE) |
99 | #define PDC_CONSOLE_DEVICE pdc_console_device | ||
100 | static struct tty_driver * pdc_console_device (struct console *c, int *index) | 93 | static struct tty_driver * pdc_console_device (struct console *c, int *index) |
101 | { | 94 | { |
102 | extern struct tty_driver console_driver; | 95 | extern struct tty_driver console_driver; |
@@ -104,22 +97,19 @@ static struct tty_driver * pdc_console_device (struct console *c, int *index) | |||
104 | return &console_driver; | 97 | return &console_driver; |
105 | } | 98 | } |
106 | #else | 99 | #else |
107 | #define PDC_CONSOLE_DEVICE NULL | 100 | #define pdc_console_device NULL |
108 | #endif | 101 | #endif |
109 | 102 | ||
110 | static struct console pdc_cons = { | 103 | static struct console pdc_cons = { |
111 | .name = "ttyB", | 104 | .name = "ttyB", |
112 | .write = pdc_console_write, | 105 | .write = pdc_console_write, |
113 | .device = PDC_CONSOLE_DEVICE, | 106 | .device = pdc_console_device, |
114 | .setup = pdc_console_setup, | 107 | .setup = pdc_console_setup, |
115 | .flags = CON_BOOT|CON_PRINTBUFFER|CON_ENABLED, | 108 | .flags = CON_BOOT | CON_PRINTBUFFER | CON_ENABLED, |
116 | .index = -1, | 109 | .index = -1, |
117 | }; | 110 | }; |
118 | 111 | ||
119 | static int pdc_console_initialized; | 112 | static int pdc_console_initialized; |
120 | extern unsigned long con_start; /* kernel/printk.c */ | ||
121 | extern unsigned long log_end; /* kernel/printk.c */ | ||
122 | |||
123 | 113 | ||
124 | static void pdc_console_init_force(void) | 114 | static void pdc_console_init_force(void) |
125 | { | 115 | { |
@@ -146,27 +136,11 @@ void __init pdc_console_init(void) | |||
146 | } | 136 | } |
147 | 137 | ||
148 | 138 | ||
149 | /* Unregister the pdc console with the printk console layer */ | ||
150 | void pdc_console_die(void) | ||
151 | { | ||
152 | if (!pdc_console_initialized) | ||
153 | return; | ||
154 | --pdc_console_initialized; | ||
155 | |||
156 | printk(KERN_INFO "Switching from PDC console\n"); | ||
157 | |||
158 | /* Don't repeat what we've already printed */ | ||
159 | con_start = log_end; | ||
160 | |||
161 | unregister_console(&pdc_cons); | ||
162 | } | ||
163 | |||
164 | |||
165 | /* | 139 | /* |
166 | * Used for emergencies. Currently only used if an HPMC occurs. If an | 140 | * Used for emergencies. Currently only used if an HPMC occurs. If an |
167 | * HPMC occurs, it is possible that the current console may not be | 141 | * HPMC occurs, it is possible that the current console may not be |
168 | * properly initialed after the PDC IO reset. This routine unregisters all | 142 | * properly initialised after the PDC IO reset. This routine unregisters |
169 | * of the current consoles, reinitializes the pdc console and | 143 | * all of the current consoles, reinitializes the pdc console and |
170 | * registers it. | 144 | * registers it. |
171 | */ | 145 | */ |
172 | 146 | ||
@@ -177,13 +151,13 @@ void pdc_console_restart(void) | |||
177 | if (pdc_console_initialized) | 151 | if (pdc_console_initialized) |
178 | return; | 152 | return; |
179 | 153 | ||
154 | /* If we've already seen the output, don't bother to print it again */ | ||
155 | if (console_drivers != NULL) | ||
156 | pdc_cons.flags &= ~CON_PRINTBUFFER; | ||
157 | |||
180 | while ((console = console_drivers) != NULL) | 158 | while ((console = console_drivers) != NULL) |
181 | unregister_console(console_drivers); | 159 | unregister_console(console_drivers); |
182 | 160 | ||
183 | /* Don't repeat what we've already printed */ | ||
184 | con_start = log_end; | ||
185 | |||
186 | /* force registering the pdc console */ | 161 | /* force registering the pdc console */ |
187 | pdc_console_init_force(); | 162 | pdc_console_init_force(); |
188 | } | 163 | } |
189 | |||