From owner-svn-src-stable-8@FreeBSD.ORG Wed Jul 7 14:19:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE274106566B; Wed, 7 Jul 2010 14:19:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3FD48FC1E; Wed, 7 Jul 2010 14:19:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67EJw2U014256; Wed, 7 Jul 2010 14:19:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67EJwjs014254; Wed, 7 Jul 2010 14:19:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071419.o67EJwjs014254@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209766 - stable/8/sys/powerpc/ofw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:19:59 -0000 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);