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))
_______________________________________________
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