From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 2849 invoked from network); 27 Jul 1998 02:04:27 -0000 Received: from dot.cygnus.com (205.180.230.224) by mail2.redhat.com with SMTP; 27 Jul 1998 02:04:27 -0000 Received: (from rth@localhost) by dot.cygnus.com (8.8.5/8.8.5) id SAA02395; Fri, 18 Jun 1999 18:27:37 -0700 Message-ID: <19990618182736.A1216@dot.cygnus.com> Date: Fri, 18 Jun 1999 18:27:36 -0700 From: Richard Henderson To: mj@atrey.karlin.mff.cuni.cz Cc: linux-kernel@vger.rutgers.edu, Quant-X Alpha Linux Support , axp-list@redhat.com Subject: vgacon oops [Re: 2.1.111 strange ...] Reply-To: Richard Henderson References: <199807260104.DAA01714@stefan.sime.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199807260104.DAA01714@stefan.sime.com>; from Quant-X Alpha Linux Support on Sun, Jul 26, 1998 at 03:04:12AM +0200 On Sun, Jul 26, 1998 at 03:04:12AM +0200, Quant-X Alpha Linux Support wrote: > Hi Stefan ! > > [2.1.111 on AlphaPC LX164] > > > Some times my internal modem card refuses to work and, the worst thing: > > gpm produces a kernel oops with the first mouseclick... > > I can reproduce it here (mouse). Tsk, tsk, Martin. You forgot to use the screen access functions. Also its always good to hoist comparisons out of such small loops. r~ --- 2.1.111/drivers/video/vgacon.c Fri Jun 18 18:20:30 1999 +++ 2.1.111-axp/drivers/video/vgacon.c Sun Jul 26 18:50:54 1998 @@ -347,13 +347,19 @@ static void vgacon_invert_region(struct { int col = vga_can_do_color; - while (count--) { - u16 a = *p; - if (col) - a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4); - else + if (col) { + while (count--) { + u16 a = scr_readw(p); + a = (((a) & 0x88ff) | (((a) & 0x7000) >> 4) + | (((a) & 0x0700) << 4)); + scr_writew(a, p++); + } + } else { + while (count--) { + u16 a = scr_readw(p); a ^= ((a & 0x0700) == 0x0100) ? 0x7000 : 0x7700; - *p++ = a; + scr_writew(a, p++); + } } }