[parisc-linux-cvs] pdc_cons.c fix

Thomas Bogendoerfer tsbogend@alpha.franken.de
Wed, 14 Nov 2001 00:47:52 +0100


Hi,

I've fixed the log_size compile error in pdc_cons.c and put back the old
console behaviour.

Thomas.

Index: arch/parisc/kernel/pdc_cons.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/pdc_cons.c,v
retrieving revision 1.28
diff -u -r1.28 pdc_cons.c
--- arch/parisc/kernel/pdc_cons.c	2001/06/20 14:16:10	1.28
+++ arch/parisc/kernel/pdc_cons.c	2001/11/13 23:22:15
@@ -53,7 +53,8 @@
 };
 
 static int pdc_console_initialized;
-extern unsigned long log_size;		/* kernel/printk.c */
+extern unsigned long con_start;	/* kernel/printk.c */
+extern unsigned long log_end;	/* kernel/printk.c */
 
 
 static void pdc_console_init_force(void)
@@ -89,7 +90,7 @@
 	printk(KERN_INFO "Switching from PDC console\n");
 
 	/* Don't repeat what we've already printed */
-	log_size = 0;
+	con_start = log_end;
 
 	unregister_console(&pdc_cons);
 }
@@ -114,7 +115,7 @@
 		unregister_console(console_drivers);
 
 	/* Don't repeat what we've already printed */
-	log_size = 0;
+	con_start = log_end;
 	
 	/* force registering the pdc console */
 	pdc_console_init_force();
Index: kernel/printk.c
===================================================================
RCS file: /home/cvs/parisc/linux/kernel/printk.c,v
retrieving revision 1.13
diff -u -r1.13 printk.c
--- kernel/printk.c	2001/11/09 23:37:17	1.13
+++ kernel/printk.c	2001/11/13 23:21:41
@@ -78,8 +78,8 @@
  * must be masked before subscripting
  */
 static unsigned long log_start;			/* Index into log_buf: next char to be read by syslog() */
-static unsigned long con_start;			/* Index into log_buf: next char to be sent to consoles */
-static unsigned long log_end;			/* Index into log_buf: most-recently-written-char + 1 */
+unsigned long con_start;			/* Index into log_buf: next char to be sent to consoles */
+unsigned long log_end;			/* Index into log_buf: most-recently-written-char + 1 */
 static unsigned long logged_chars;		/* Number of chars produced since last read+clear operation */
 
 struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
@@ -585,6 +585,11 @@
 
 	if (!(console->flags & CON_ENABLED))
 		return;
+    
+        if (console_drivers && (console_drivers->flags & CON_BOOT)) {
+                unregister_console(console_drivers);
+                console->flags &= ~CON_PRINTBUFFER;
+        }
 
 	/*
 	 *	Put this console in the list - keep the

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                 [ Alexander Viro on linux-kernel ]