From owner-svn-src-stable-9@FreeBSD.ORG Tue Jul 17 19:00:47 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 502E11065670; Tue, 17 Jul 2012 19:00:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2988FC17; Tue, 17 Jul 2012 19:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6HJ0ldW083905; Tue, 17 Jul 2012 19:00:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6HJ0lui083903; Tue, 17 Jul 2012 19:00:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207171900.q6HJ0lui083903@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jul 2012 19:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238555 - stable/9/sys/dev/fb X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 19:00:47 -0000 Author: kib Date: Tue Jul 17 19:00:46 2012 New Revision: 238555 URL: http://svn.freebsd.org/changeset/base/238555 Log: MFC r237203,r237223 (by phk): Fix writes to the video memory of the VGA to always use half-word sized writes. Approved by: re (hrs), phk Modified: stable/9/sys/dev/fb/fbreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/fb/fbreg.h ============================================================================== --- stable/9/sys/dev/fb/fbreg.h Tue Jul 17 18:04:34 2012 (r238554) +++ stable/9/sys/dev/fb/fbreg.h Tue Jul 17 19:00:46 2012 (r238555) @@ -35,9 +35,17 @@ /* some macros */ #if defined(__amd64__) || defined(__i386__) -#define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) + +static __inline void +copyw(uint16_t *src, uint16_t *dst, size_t size) +{ + size >>= 1; + while (size--) + *dst++ = *src++; +} +#define bcopy_io(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_toio(s, d, c) copyw((void*)(s), (void*)(d), (c)) +#define bcopy_fromio(s, d, c) copyw((void*)(s), (void*)(d), (c)) #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c))