From 2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 4 May 1998 09:12:48 +0000 Subject: o New memset. Fastest in town for size > 6 bytes. o New clear_user. o Memcpy now efficiently copies the (src^dest)&3 != 0. o Memmove new correctly deals with overlaps o Rewrite csum_partial in assembler. o Rewrte csum_partial_from_user in assembler. o __copy_user is now integrated with memcpy. o get_user now returns a zero value on error. o copy_from_user now clears the destination buffer on error. o strncpy_user now has a more efficient caller routine. o strlen_user now has a more efficient caller routines and is faster. o The unaligned handler is now much cleaner. It's now also save from interrupt. Some more esotheric bugs fixed as well. o Don't export bcopy anymore, it's now a inline function. o Delete ancient junk from the first days of Linux/MIPS. o Delete dead code in indy_sc.c. o Including the IDE driver doesn't crash an Indy anymore. o Eleminate active_ds. We now use current_ds directly in the thread structure which is faster and threadsafe. Saves almost 2kb on the kernel. o Serial console should work again. --- drivers/sgi/char/sgiserial.c | 45 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'drivers/sgi') diff --git a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c index 12176d6d2..7239e216b 100644 --- a/drivers/sgi/char/sgiserial.c +++ b/drivers/sgi/char/sgiserial.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id$ + * $Id: sgiserial.c,v 1.8 1998/04/05 11:24:34 ralf Exp $ */ #include /* for CONFIG_REMOTE_DEBUG */ @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,19 @@ static int zs_cons_chanout = 0; static int zs_cons_chanin = 0; struct sgi_serial *zs_consinfo = 0; +static struct console sgi_console_driver = { + "debug", + NULL, /* write */ + NULL, /* read */ + NULL, /* device */ + NULL, /* wait_key */ + NULL, /* unblank */ + NULL, /* setup */ + CON_PRINTBUFFER, + -1, + 0, + NULL +}; static unsigned char kgdb_regs[16] = { 0, 0, 0, /* write 0, 1, 2 */ (Rx8 | RxENABLE), /* write 3 */ @@ -963,14 +977,14 @@ static void rs_fair_output(void) /* * zs_console_print is registered for printk. */ -static void zs_console_print(const char *p) + +static void zs_console_print(struct console *co, const char *str, unsigned int count) { - char c; - while((c=*(p++)) != 0) { - if(c == '\n') + while(count--) { + if(*str == '\n') rs_put_char('\r'); - rs_put_char(c); + rs_put_char(*str++); } /* Comment this if you want to have a strict interrupt-driven output */ @@ -1715,7 +1729,7 @@ static inline struct sgi_zslayout *get_zs(int chip) } -extern void register_console(void (*proc)(const char *)); + static inline void rs_cons_check(struct sgi_serial *ss, int channel) @@ -1726,6 +1740,7 @@ rs_cons_check(struct sgi_serial *ss, int channel) i = o = io = 0; + /* Is this one of the serial console lines? */ if((zs_cons_chanout != channel) && (zs_cons_chanin != channel)) @@ -1733,16 +1748,20 @@ rs_cons_check(struct sgi_serial *ss, int channel) zs_conschan = ss->zs_channel; zs_consinfo = ss; + /* Register the console output putchar, if necessary */ if((zs_cons_chanout == channel)) { o = 1; /* double whee.. */ + if(!consout_registered) { - register_console(zs_console_print); + sgi_console_driver.write = zs_console_print; + register_console(&sgi_console_driver); consout_registered = 1; } } + /* If this is console input, we handle the break received * status interrupt on this line to mean prom_halt(). */ @@ -1759,6 +1778,7 @@ rs_cons_check(struct sgi_serial *ss, int channel) panic("Console baud rate weirdness"); } + /* Set flag variable for this port so that it cannot be * opened for other uses by accident. */ @@ -1769,9 +1789,11 @@ rs_cons_check(struct sgi_serial *ss, int channel) printk("zs%d: console I/O\n", ((channel>>1)&1)); msg_printed = 1; } + } else { printk("zs%d: console %s\n", ((channel>>1)&1), (i==1 ? "input" : (o==1 ? "output" : "WEIRD"))); + } } @@ -1783,6 +1805,7 @@ int rs_init(void) int chip, channel, i, flags; struct sgi_serial *info; + /* Setup base handler, and timer table. */ init_bh(SERIAL_BH, do_serial_bh); timer_table[RS_TIMER].fn = rs_timer; @@ -1969,6 +1992,7 @@ rs_cons_hook(int chip, int out, int line) { int channel; + if(chip) panic("rs_cons_hook called with chip not zero"); if(line != 1 && line != 2) @@ -1984,10 +2008,11 @@ rs_cons_hook(int chip, int out, int line) zs_soft[channel].change_needed = 0; zs_soft[channel].clk_divisor = 16; zs_soft[channel].zs_baud = get_zsbaud(&zs_soft[channel]); - if(out) + if(out) zs_cons_chanout = ((chip * 2) + channel); - else + else zs_cons_chanin = ((chip * 2) + channel); + rs_cons_check(&zs_soft[channel], channel); } -- cgit v1.2.3