patch-2.4.0-test12 linux/arch/m68k/mvme147/config.c

Next file: linux/arch/m68k/q40/README
Previous file: linux/arch/m68k/mm/fault.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/arch/m68k/mvme147/config.c linux/arch/m68k/mvme147/config.c
@@ -201,15 +201,6 @@
 
 /*-------------------  Serial console stuff ------------------------*/
 
-void m147_scc_write(struct console *co, const char *str, unsigned cnt);
-
-
-void mvme147_init_console_port (struct console *co, int cflag)
-{
-	co->write = m147_scc_write;
-}
-
-
 static void scc_delay (void)
 {
 	int n;
@@ -250,3 +241,31 @@
 	restore_flags(flags);
 }
 
+
+static int m147_scc_wait_key (struct console *co)
+{
+	volatile unsigned char *p = (volatile char *)M147_SCC_A_ADDR;
+	unsigned long	flags;
+	int		c;
+
+	/* wait for rx buf filled */
+	while ((*p & 0x01) == 0)
+		;
+
+	save_flags(flags);
+	cli();
+
+	*p = 8;
+	scc_delay();
+	c = *p;
+
+	restore_flags(flags);
+	return c;
+}
+
+
+void mvme147_init_console_port (struct console *co, int cflag)
+{
+	co->write    = m147_scc_write;
+	co->wait_key = m147_scc_wait_key;
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)