From 6c35be946a90590a58fca307be129bf835543176 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Sat, 25 Aug 2007 00:25:44 +0000 Subject: [PATCH] Save/restore curlwp on calling ROM_GETC() and ROM_PUTC() functions, which might break %s7 register. --- sys/arch/ews4800mips/ews4800mips/cons_machdep.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/arch/ews4800mips/ews4800mips/cons_machdep.c b/sys/arch/ews4800mips/ews4800mips/cons_machdep.c index 61eda3556981..282b557f4cc9 100644 --- a/sys/arch/ews4800mips/ews4800mips/cons_machdep.c +++ b/sys/arch/ews4800mips/ews4800mips/cons_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: cons_machdep.c,v 1.3 2007/02/22 05:31:52 thorpej Exp $ */ +/* $NetBSD: cons_machdep.c,v 1.4 2007/08/25 00:25:44 tsutsui Exp $ */ /*- * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cons_machdep.c,v 1.3 2007/02/22 05:31:52 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cons_machdep.c,v 1.4 2007/08/25 00:25:44 tsutsui Exp $"); #include #include @@ -118,6 +118,9 @@ void rom_cnputc(dev_t dev, int c) { int i; + struct lwp *curlwp_save; + + curlwp_save = curlwp; switch (c) { default: @@ -155,6 +158,8 @@ rom_cnputc(dev_t dev, int c) break; } + curlwp = curlwp_save; + if (cons.y == CONS_HEIGHT) cons.y = Y_INIT; } @@ -162,8 +167,14 @@ rom_cnputc(dev_t dev, int c) int rom_cngetc(dev_t dev) { + int rval; + struct lwp *curlwp_save; - return ROM_GETC(); + curlwp_save = curlwp; + rval = ROM_GETC(); + curlwp = curlwp_save; + + return rval; } void