Module Name: src Committed By: thorpej Date: Fri Mar 13 04:08:07 UTC 2020
Modified Files: src/sys/dev/ic: rtl8169.c rtl81x9reg.h Log Message: Use BUS_ADDR_{LO,HI}32(). To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/sys/dev/ic/rtl8169.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/rtl81x9reg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/rtl8169.c diff -u src/sys/dev/ic/rtl8169.c:1.165 src/sys/dev/ic/rtl8169.c:1.166 --- src/sys/dev/ic/rtl8169.c:1.165 Thu Mar 12 03:01:46 2020 +++ src/sys/dev/ic/rtl8169.c Fri Mar 13 04:08:07 2020 @@ -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 @@ static inline void 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 Index: src/sys/dev/ic/rtl81x9reg.h diff -u src/sys/dev/ic/rtl81x9reg.h:1.52 src/sys/dev/ic/rtl81x9reg.h:1.53 --- src/sys/dev/ic/rtl81x9reg.h:1.52 Tue Dec 17 10:42:06 2019 +++ src/sys/dev/ic/rtl81x9reg.h Fri Mar 13 04:08:07 2020 @@ -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 @@ struct re_desc { #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)