Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix build error related to ixl(4) on i386



details:   https://anonhg.NetBSD.org/src/rev/05e1379f89bb
branches:  trunk
changeset: 466074:05e1379f89bb
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Wed Dec 11 05:50:03 2019 +0000

description:
Fix build error related to ixl(4) on i386

diffstat:

 sys/dev/pci/if_ixl.c |  32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diffs (54 lines):

diff -r 7333225b84fe -r 05e1379f89bb sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Wed Dec 11 02:31:44 2019 +0000
+++ b/sys/dev/pci/if_ixl.c      Wed Dec 11 05:50:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.2 2019/12/11 01:51:22 yamaguchi Exp $     */
+/*     $NetBSD: if_ixl.c,v 1.3 2019/12/11 05:50:03 yamaguchi Exp $     */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -807,14 +807,17 @@
 static inline uint32_t
 ixl_dmamem_hi(struct ixl_dmamem *ixm)
 {
-       uint32_t val;
-
-       if (sizeof(IXL_DMA_DVA(ixm)) > 4)
-               val = (uint32_t)(IXL_DMA_DVA(ixm) >> 32);
-       else
-               val = 0;
-
-       return val;
+       uint32_t retval;
+       uint64_t val;
+
+       if (sizeof(bus_addr_t) > 4) {
+               val = (intptr_t)IXL_DMA_DVA(ixm);
+               retval = (uint32_t)(val >> 32);
+       } else {
+               retval = 0;
+       }
+
+       return retval;
 }
 
 static inline uint32_t
@@ -827,11 +830,14 @@
 static inline void
 ixl_aq_dva(struct ixl_aq_desc *iaq, bus_addr_t addr)
 {
-
-       if (sizeof(addr) > 4)
-               iaq->iaq_param[2] = htole32(addr >> 32);
-       else
+       uint64_t val;
+
+       if (sizeof(bus_addr_t) > 4) {
+               val = (intptr_t)addr;
+               iaq->iaq_param[2] = htole32(val >> 32);
+       } else {
                iaq->iaq_param[2] = htole32(0);
+       }
 
        iaq->iaq_param[3] = htole32(addr);
 }



Home | Main Index | Thread Index | Old Index