diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-06-15 22:01:38 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-06-15 22:01:38 +0000 |
commit | 889674afbf30cbc0a5f42a4c70ab6950101db88b (patch) | |
tree | f05c15e8d79b39098dbb1aa65e9a877e999784ea /sys/powerpc | |
parent | 714627407c8f3537554ec37fbed5f17383327427 (diff) | |
download | FreeBSD-src-889674afbf30cbc0a5f42a4c70ab6950101db88b.zip FreeBSD-src-889674afbf30cbc0a5f42a4c70ab6950101db88b.tar.gz |
Modify the console mouse pointer drawing routine to use single-byte writes
instead of 4-byte ones. Because the mouse pointer can start part way
through a character cell, 4-byte memory operations are not necessarily
aligned, triggering a fatal alignment exception when the console pointer
was moved on PowerPC G5 systems.
MFC after: 3 days
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/ofw/ofw_syscons.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/powerpc/ofw/ofw_syscons.c b/sys/powerpc/ofw/ofw_syscons.c index d85cee5..65277cc 100644 --- a/sys/powerpc/ofw/ofw_syscons.c +++ b/sys/powerpc/ofw/ofw_syscons.c @@ -856,16 +856,11 @@ ofwfb_putm8(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, { struct ofwfb_softc *sc; int i, j, k; - uint32_t *addr; + uint8_t *addr; u_char fg, bg; - union { - uint32_t l[2]; - uint8_t c[8]; - } ch; - sc = (struct ofwfb_softc *)adp; - addr = (u_int32_t *)((int)sc->sc_addr + addr = (u_int8_t *)((int)sc->sc_addr + (y + sc->sc_ymargin)*sc->sc_stride + x + sc->sc_xmargin); @@ -874,12 +869,6 @@ ofwfb_putm8(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { /* - * Use the current values for the line - */ - ch.l[0] = addr[0]; - ch.l[1] = addr[1]; - - /* * Calculate 2 x 4-chars at a time, and then * write these out. */ @@ -888,12 +877,10 @@ ofwfb_putm8(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, continue; if (pixel_image[i] & (1 << k)) - ch.c[j] = (ch.c[j] == fg) ? bg : fg; + addr[j] = (addr[j] == fg) ? bg : fg; } - addr[0] = ch.l[0]; - addr[1] = ch.l[1]; - addr += (sc->sc_stride / sizeof(u_int32_t)); + addr += (sc->sc_stride / sizeof(u_int8_t)); } return (0); |