Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Simulate bus_space_read_...



details:   https://anonhg.NetBSD.org/src/rev/7956fbe97245
branches:  trunk
changeset: 993138:7956fbe97245
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 16:15:34 2018 +0000

description:
Simulate bus_space_read_8 with two bus_space_read_4 on 32-bit x86.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 322f28db8f91 -r 7956fbe97245 sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.c   Mon Aug 27 16:15:23 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_vgpu.c   Mon Aug 27 16:15:34 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_vgpu.c,v 1.3 2018/08/27 07:16:10 riastradh Exp $  */
+/*     $NetBSD: i915_vgpu.c,v 1.4 2018/08/27 16:15:34 riastradh Exp $  */
 
 /*
  * Copyright(c) 2011-2015 Intel Corporation. All rights reserved.
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_vgpu.c,v 1.3 2018/08/27 07:16:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_vgpu.c,v 1.4 2018/08/27 16:15:34 riastradh Exp $");
 
 #include "intel_drv.h"
 #include "i915_vgpu.h"
@@ -75,8 +75,15 @@
                return;
 
 #ifdef __NetBSD__
+#  ifdef _LP64
        magic = bus_space_read_8(dev_priv->regs_bst, dev_priv->regs_bsh,
            vgtif_reg(magic));
+#  else
+       magic = bus_space_read_4(dev_priv->regs_bst, dev_priv->regs_bsh,
+           vgtif_reg(magic));
+       magic |= (uint64_t)bus_space_read_4(dev_priv->regs_bst,
+           dev_priv->regs_bsh, vgtif_reg(magic) + 4) << 32;
+#  endif
 #else
        magic = readq(dev_priv->regs + vgtif_reg(magic));
 #endif



Home | Main Index | Thread Index | Old Index