Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Make this compile on sparc64:
details: https://anonhg.NetBSD.org/src/rev/87c49b06807e
branches: trunk
changeset: 753109:87c49b06807e
user: dyoung <dyoung%NetBSD.org@localhost>
date: Mon Mar 15 23:21:08 2010 +0000
description:
Make this compile on sparc64:
1 s/next_tick/next_tint/ because next_tick shadows a global on sparc64.
2 Fix the bus-barrier helper routines, which had the tag & handle
swapped (!!). Move the helpers from rtwreg.h to rtwvar.h, and
change RTW_BARRIER() into an inline subroutine called rtw_barrier().
diffstat:
sys/dev/ic/rtw.c | 12 ++++++------
sys/dev/ic/rtwreg.h | 41 +----------------------------------------
sys/dev/ic/rtwvar.h | 44 +++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 50 insertions(+), 47 deletions(-)
diffs (155 lines):
diff -r 93964316ccf8 -r 87c49b06807e sys/dev/ic/rtw.c
--- a/sys/dev/ic/rtw.c Mon Mar 15 20:35:19 2010 +0000
+++ b/sys/dev/ic/rtw.c Mon Mar 15 23:21:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtw.c,v 1.114 2010/02/24 22:37:58 dyoung Exp $ */
+/* $NetBSD: rtw.c,v 1.115 2010/03/15 23:21:08 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005, 2006, 2007 David Young. All rights
* reserved.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.114 2010/02/24 22:37:58 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.115 2010/03/15 23:21:08 dyoung Exp $");
#include <sys/param.h>
@@ -2095,19 +2095,19 @@
static inline void
rtw_resume_ticks(struct rtw_softc *sc)
{
- uint32_t tsftrl0, tsftrl1, next_tick;
+ uint32_t tsftrl0, tsftrl1, next_tint;
tsftrl0 = RTW_READ(&sc->sc_regs, RTW_TSFTRL);
tsftrl1 = RTW_READ(&sc->sc_regs, RTW_TSFTRL);
- next_tick = tsftrl1 + 1000000;
- RTW_WRITE(&sc->sc_regs, RTW_TINT, next_tick);
+ next_tint = tsftrl1 + 1000000;
+ RTW_WRITE(&sc->sc_regs, RTW_TINT, next_tint);
sc->sc_do_tick = 1;
RTW_DPRINTF(RTW_DEBUG_TIMEOUT,
("%s: resume ticks delta %#08x now %#08x next %#08x\n",
- device_xname(sc->sc_dev), tsftrl1 - tsftrl0, tsftrl1, next_tick));
+ device_xname(sc->sc_dev), tsftrl1 - tsftrl0, tsftrl1, next_tint));
}
static void
diff -r 93964316ccf8 -r 87c49b06807e sys/dev/ic/rtwreg.h
--- a/sys/dev/ic/rtwreg.h Mon Mar 15 20:35:19 2010 +0000
+++ b/sys/dev/ic/rtwreg.h Mon Mar 15 23:21:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtwreg.h,v 1.27 2009/10/19 23:19:39 rmind Exp $ */
+/* $NetBSD: rtwreg.h,v 1.28 2010/03/15 23:21:08 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005 David Young. All rights reserved.
*
@@ -1013,45 +1013,6 @@
#endif
/*
- * Bus barrier
- *
- * Complete outstanding read and/or write ops on [reg0, reg1]
- * ([reg1, reg0]) before starting new ops on the same region. See
- * acceptable bus_space_barrier(9) for the flag definitions.
- */
-#define RTW_BARRIER(regs, reg0, reg1, flags) \
- bus_space_barrier((regs)->r_bh, (regs)->r_bt, \
- MIN(reg0, reg1), MAX(reg0, reg1) - MIN(reg0, reg1) + 4, flags)
-
-/*
- * Barrier convenience macros.
- */
-/* sync */
-#define RTW_SYNC(regs, reg0, reg1) \
- RTW_BARRIER(regs, reg0, reg1, BUS_SPACE_BARRIER_SYNC)
-
-/* write-before-write */
-#define RTW_WBW(regs, reg0, reg1) \
- RTW_BARRIER(regs, reg0, reg1, BUS_SPACE_BARRIER_WRITE_BEFORE_WRITE)
-
-/* write-before-read */
-#define RTW_WBR(regs, reg0, reg1) \
- RTW_BARRIER(regs, reg0, reg1, BUS_SPACE_BARRIER_WRITE_BEFORE_READ)
-
-/* read-before-read */
-#define RTW_RBR(regs, reg0, reg1) \
- RTW_BARRIER(regs, reg0, reg1, BUS_SPACE_BARRIER_READ_BEFORE_READ)
-
-/* read-before-write */
-#define RTW_RBW(regs, reg0, reg1) \
- RTW_BARRIER(regs, reg0, reg1, BUS_SPACE_BARRIER_READ_BEFORE_WRITE)
-
-#define RTW_WBRW(regs, reg0, reg1) \
- RTW_BARRIER(regs, reg0, reg1, \
- BUS_SPACE_BARRIER_WRITE_BEFORE_READ | \
- BUS_SPACE_BARRIER_WRITE_BEFORE_WRITE)
-
-/*
* Registers for RTL8180L's built-in baseband modem.
*/
#define RTW_BBP_SYS1 0x00
diff -r 93964316ccf8 -r 87c49b06807e sys/dev/ic/rtwvar.h
--- a/sys/dev/ic/rtwvar.h Mon Mar 15 20:35:19 2010 +0000
+++ b/sys/dev/ic/rtwvar.h Mon Mar 15 23:21:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtwvar.h,v 1.42 2010/02/24 22:37:58 dyoung Exp $ */
+/* $NetBSD: rtwvar.h,v 1.43 2010/03/15 23:21:08 dyoung Exp $ */
/*-
* Copyright (c) 2004, 2005 David Young. All rights reserved.
*
@@ -112,6 +112,48 @@
enum rtw_access r_access;
};
+/*
+ * Bus barrier
+ *
+ * Complete outstanding read and/or write ops on [reg0, reg1]
+ * ([reg1, reg0]) before starting new ops on the same region. See
+ * acceptable bus_space_barrier(9) for the flag definitions.
+ */
+static inline void
+rtw_barrier(const struct rtw_regs *r, int reg0, int reg1, int flags)
+{
+ bus_space_barrier(r->r_bt, r->r_bh, MIN(reg0, reg1),
+ MAX(reg0, reg1) - MIN(reg0, reg1) + 4, flags);
+}
+
+/*
+ * Barrier convenience macros.
+ */
+/* sync */
+#define RTW_SYNC(regs, reg0, reg1) \
+ rtw_barrier(regs, reg0, reg1, BUS_SPACE_BARRIER_SYNC)
+
+/* write-before-write */
+#define RTW_WBW(regs, reg0, reg1) \
+ rtw_barrier(regs, reg0, reg1, BUS_SPACE_BARRIER_WRITE_BEFORE_WRITE)
+
+/* write-before-read */
+#define RTW_WBR(regs, reg0, reg1) \
+ rtw_barrier(regs, reg0, reg1, BUS_SPACE_BARRIER_WRITE_BEFORE_READ)
+
+/* read-before-read */
+#define RTW_RBR(regs, reg0, reg1) \
+ rtw_barrier(regs, reg0, reg1, BUS_SPACE_BARRIER_READ_BEFORE_READ)
+
+/* read-before-write */
+#define RTW_RBW(regs, reg0, reg1) \
+ rtw_barrier(regs, reg0, reg1, BUS_SPACE_BARRIER_READ_BEFORE_WRITE)
+
+#define RTW_WBRW(regs, reg0, reg1) \
+ rtw_barrier(regs, reg0, reg1, \
+ BUS_SPACE_BARRIER_WRITE_BEFORE_READ | \
+ BUS_SPACE_BARRIER_WRITE_BEFORE_WRITE)
+
#define RTW_SR_GET(sr, ofs) \
(((sr)->sr_content[(ofs)/2] >> (((ofs) % 2 == 0) ? 0 : 8)) & 0xff)
Home |
Main Index |
Thread Index |
Old Index