vgacon oops [Re: 2.1.111 strange ...]

Richard Henderson (rth@dot.cygnus.com)
Fri, 18 Jun 1999 18:27:36 -0700


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++);
+ }
}
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html