Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Use BUS_ADDR_{LO,HI}32().



details:   https://anonhg.NetBSD.org/src/rev/95a17bd4c82a
branches:  trunk
changeset: 1008149:95a17bd4c82a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Mar 13 04:08:07 2020 +0000

description:
Use BUS_ADDR_{LO,HI}32().

diffstat:

 sys/dev/ic/rtl8169.c    |  11 ++++-------
 sys/dev/ic/rtl81x9reg.h |   6 +++---
 2 files changed, 7 insertions(+), 10 deletions(-)

diffs (52 lines):

diff -r a8e2e1feffc9 -r 95a17bd4c82a sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Fri Mar 13 03:49:39 2020 +0000
+++ b/sys/dev/ic/rtl8169.c      Fri Mar 13 04:08:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl8169.c,v 1.165 2020/03/12 03:01:46 thorpej Exp $    */
+/*     $NetBSD: rtl8169.c,v 1.166 2020/03/13 04:08:07 thorpej Exp $    */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.165 2020/03/12 03:01:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.166 2020/03/13 04:08:07 thorpej Exp $");
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -176,11 +176,8 @@
 re_set_bufaddr(struct re_desc *d, bus_addr_t addr)
 {
 
-       d->re_bufaddr_lo = htole32((uint32_t)addr);
-       if (sizeof(bus_addr_t) == sizeof(uint64_t))
-               d->re_bufaddr_hi = htole32((uint64_t)addr >> 32);
-       else
-               d->re_bufaddr_hi = 0;
+       d->re_bufaddr_lo = htole32(RE_ADDR_LO(addr));
+       d->re_bufaddr_hi = htole32(RE_ADDR_HI(addr));
 }
 
 static int
diff -r a8e2e1feffc9 -r 95a17bd4c82a sys/dev/ic/rtl81x9reg.h
--- a/sys/dev/ic/rtl81x9reg.h   Fri Mar 13 03:49:39 2020 +0000
+++ b/sys/dev/ic/rtl81x9reg.h   Fri Mar 13 04:08:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl81x9reg.h,v 1.52 2019/12/17 10:42:06 msaitoh Exp $  */
+/*     $NetBSD: rtl81x9reg.h,v 1.53 2020/03/13 04:08:07 thorpej Exp $  */
 
 /*
  * Copyright (c) 1997, 1998
@@ -588,8 +588,8 @@
 #define RE_UDPPKT(x)           (((x) & RE_RDESC_STAT_PROTOID) == \
                                 RE_PROTOID_UDPIP)
 
-#define RE_ADDR_LO(y)          ((uint64_t)(y) & 0xFFFFFFFF)
-#define RE_ADDR_HI(y)          ((uint64_t)(y) >> 32)
+#define RE_ADDR_LO(y)          BUS_ADDR_LO32(y)
+#define RE_ADDR_HI(y)          BUS_ADDR_HI32(y)
 
 /*
  * Statistics counter structure (8139C+ and 8169 only)



Home | Main Index | Thread Index | Old Index