Author: nwhitehorn
Date: Wed Jul  7 14:19:58 2010
New Revision: 209766
URL: http://svn.freebsd.org/changeset/base/209766

Log:
  MFC r209222:
  
  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.

Modified:
  stable/8/sys/powerpc/ofw/ofw_syscons.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/powerpc/ofw/ofw_syscons.c
==============================================================================
--- stable/8/sys/powerpc/ofw/ofw_syscons.c      Wed Jul  7 14:15:51 2010        
(r209765)
+++ stable/8/sys/powerpc/ofw/ofw_syscons.c      Wed Jul  7 14:19:58 2010        
(r209766)
@@ -856,16 +856,11 @@ ofwfb_putm8(video_adapter_t *adp, int x,
 {
        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,
 
        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,
                                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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to