Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/isa Remove unneeded bus_space_barrier() calls.
details: https://anonhg.NetBSD.org/src/rev/d63f8ac95e64
branches: trunk
changeset: 368447:d63f8ac95e64
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Jul 12 02:03:57 2022 +0000
description:
Remove unneeded bus_space_barrier() calls.
diffstat:
sys/dev/isa/if_ai.c | 20 +---------
sys/dev/isa/if_ef.c | 17 +--------
sys/dev/isa/if_ix.c | 98 +---------------------------------------------------
3 files changed, 7 insertions(+), 128 deletions(-)
diffs (truncated from 431 to 300 lines):
diff -r c83033778d13 -r d63f8ac95e64 sys/dev/isa/if_ai.c
--- a/sys/dev/isa/if_ai.c Tue Jul 12 01:51:05 2022 +0000
+++ b/sys/dev/isa/if_ai.c Tue Jul 12 02:03:57 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ai.c,v 1.35 2019/04/09 05:25:14 msaitoh Exp $ */
+/* $NetBSD: if_ai.c,v 1.36 2022/07/12 02:03:57 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ai.c,v 1.35 2019/04/09 05:25:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ai.c,v 1.36 2022/07/12 02:03:57 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -139,9 +139,6 @@
int dribble;
uint8_t *bptr = dst;
- bus_space_barrier(sc->bt, sc->bh, offset, size,
- BUS_SPACE_BARRIER_READ);
-
if (offset % 2) {
*bptr = bus_space_read_1(sc->bt, sc->bh, offset);
offset++; bptr++; size--;
@@ -162,8 +159,6 @@
ai_copyout(struct ie_softc *sc, const void *src, int offset, size_t size)
{
int dribble;
- int osize = size;
- int ooffset = offset;
const uint8_t *bptr = src;
if (offset % 2) {
@@ -179,16 +174,12 @@
offset += size - 1;
bus_space_write_1(sc->bt, sc->bh, offset, *bptr);
}
-
- bus_space_barrier(sc->bt, sc->bh, ooffset, osize,
- BUS_SPACE_BARRIER_WRITE);
}
static uint16_t
ai_read_16(struct ie_softc *sc, int offset)
{
- bus_space_barrier(sc->bt, sc->bh, offset, 2, BUS_SPACE_BARRIER_READ);
return bus_space_read_2(sc->bt, sc->bh, offset);
}
@@ -197,7 +188,6 @@
{
bus_space_write_2(sc->bt, sc->bh, offset, value);
- bus_space_barrier(sc->bt, sc->bh, offset, 2, BUS_SPACE_BARRIER_WRITE);
}
static void
@@ -206,7 +196,6 @@
bus_space_write_4(sc->bt, sc->bh, offset, addr +
(u_long)sc->sc_maddr - (u_long)sc->sc_iobase);
- bus_space_barrier(sc->bt, sc->bh, offset, 4, BUS_SPACE_BARRIER_WRITE);
}
int
@@ -387,8 +376,6 @@
ai_write_24(sc, IE_ISCP_BASE((u_long)sc->iscp), (u_long)sc->iscp);
/* Flush setup of pointers, check if chip answers */
- bus_space_barrier(sc->bt, sc->bh, 0, sc->sc_msize,
- BUS_SPACE_BARRIER_WRITE);
if (!i82586_proberam(sc)) {
DPRINTF(("\n%s: can't talk to i82586!\n",
device_xname(self)));
@@ -473,9 +460,6 @@
ai_write_24(sc, IE_ISCP_BASE((u_long)sc->iscp), (u_long)sc->iscp);
/* Flush setup of pointers, check if chip answers */
- bus_space_barrier(sc->bt, sc->bh, 0, sc->sc_msize,
- BUS_SPACE_BARRIER_WRITE);
-
if (!i82586_proberam(sc))
return 0;
diff -r c83033778d13 -r d63f8ac95e64 sys/dev/isa/if_ef.c
--- a/sys/dev/isa/if_ef.c Tue Jul 12 01:51:05 2022 +0000
+++ b/sys/dev/isa/if_ef.c Tue Jul 12 02:03:57 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ef.c,v 1.35 2019/11/10 21:16:35 chs Exp $ */
+/* $NetBSD: if_ef.c,v 1.36 2022/07/12 02:03:57 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.35 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.36 2022/07/12 02:03:57 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -237,7 +237,6 @@
ef_read_16(struct ie_softc *sc, int offset)
{
- bus_space_barrier(sc->bt, sc->bh, offset, 2, BUS_SPACE_BARRIER_READ);
return bus_space_read_2(sc->bt, sc->bh, offset);
}
@@ -247,9 +246,6 @@
int dribble;
uint8_t *bptr = dst;
- bus_space_barrier(sc->bt, sc->bh, offset, size,
- BUS_SPACE_BARRIER_READ);
-
if (offset % 2) {
*bptr = bus_space_read_1(sc->bt, sc->bh, offset);
offset++; bptr++; size--;
@@ -270,8 +266,6 @@
ef_copyout(struct ie_softc *sc, const void *src, int offset, size_t size)
{
int dribble;
- int osize = size;
- int ooffset = offset;
const uint8_t *bptr = src;
if (offset % 2) {
@@ -287,9 +281,6 @@
offset += size - 1;
bus_space_write_1(sc->bt, sc->bh, offset, *bptr);
}
-
- bus_space_barrier(sc->bt, sc->bh, ooffset, osize,
- BUS_SPACE_BARRIER_WRITE);
}
static void
@@ -297,7 +288,6 @@
{
bus_space_write_2(sc->bt, sc->bh, offset, value);
- bus_space_barrier(sc->bt, sc->bh, offset, 2, BUS_SPACE_BARRIER_WRITE);
}
static void
@@ -306,7 +296,6 @@
bus_space_write_4(sc->bt, sc->bh, offset,
addr + (u_long)sc->sc_maddr - (u_long)sc->sc_iobase);
- bus_space_barrier(sc->bt, sc->bh, offset, 4, BUS_SPACE_BARRIER_WRITE);
}
static void
@@ -576,8 +565,6 @@
ef_write_24(sc, IE_ISCP_BASE((u_long)sc->iscp), (u_long)sc->iscp);
/* flush setup of pointers, check if chip answers */
- bus_space_barrier(sc->bt, sc->bh, 0, sc->sc_msize,
- BUS_SPACE_BARRIER_WRITE);
if (!i82586_proberam(sc)) {
DPRINTF(("\n%s: can't talk to i82586!\n",
device_xname(self)));
diff -r c83033778d13 -r d63f8ac95e64 sys/dev/isa/if_ix.c
--- a/sys/dev/isa/if_ix.c Tue Jul 12 01:51:05 2022 +0000
+++ b/sys/dev/isa/if_ix.c Tue Jul 12 02:03:57 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ix.c,v 1.38 2019/04/25 10:08:46 msaitoh Exp $ */
+/* $NetBSD: if_ix.c,v 1.39 2022/07/12 02:03:57 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.38 2019/04/25 10:08:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.39 2022/07/12 02:03:57 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -88,8 +88,6 @@
static void ix_copyin(struct ie_softc *, void *, int, size_t);
static void ix_copyout(struct ie_softc *, const void *, int, size_t);
-static void ix_bus_barrier(struct ie_softc *, int, int, int);
-
static uint16_t ix_read_16(struct ie_softc *, int);
static void ix_write_16(struct ie_softc *, int, uint16_t);
static void ix_write_24(struct ie_softc *, int, int);
@@ -246,14 +244,8 @@
if (isc->use_pio) {
/* Reset read pointer to the specified offset */
- bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
- BUS_SPACE_BARRIER_READ);
bus_space_write_2(sc->bt, sc->bh, IX_READPTR, offset);
- bus_space_barrier(sc->bt, sc->bh, IX_READPTR, 2,
- BUS_SPACE_BARRIER_WRITE);
- } else
- bus_space_barrier(sc->bt, sc->bh, offset, size,
- BUS_SPACE_BARRIER_READ);
+ }
if (offset % 2) {
if (isc->use_pio)
@@ -290,8 +282,6 @@
ix_copyout(struct ie_softc *sc, const void *src, int offset, size_t size)
{
int i, dribble;
- int osize = size;
- int ooffset = offset;
const uint8_t *bptr = src;
const uint16_t *wptr = src;
struct ix_softc *isc = (struct ix_softc *)sc;
@@ -299,8 +289,6 @@
if (isc->use_pio) {
/* Reset write pointer to the specified offset */
bus_space_write_2(sc->bt, sc->bh, IX_WRITEPTR, offset);
- bus_space_barrier(sc->bt, sc->bh, IX_WRITEPTR, 2,
- BUS_SPACE_BARRIER_WRITE);
}
if (offset % 2) {
@@ -332,24 +320,6 @@
else
bus_space_write_1(sc->bt, sc->bh, offset, *bptr);
}
-
- if (isc->use_pio)
- bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
- BUS_SPACE_BARRIER_WRITE);
- else
- bus_space_barrier(sc->bt, sc->bh, ooffset, osize,
- BUS_SPACE_BARRIER_WRITE);
-}
-
-static void
-ix_bus_barrier(struct ie_softc *sc, int offset, int length, int flags)
-{
- struct ix_softc *isc = (struct ix_softc *)sc;
-
- if (isc->use_pio)
- bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2, flags);
- else
- bus_space_barrier(sc->bt, sc->bh, offset, length, flags);
}
static uint16_t
@@ -358,18 +328,11 @@
struct ix_softc *isc = (struct ix_softc *)sc;
if (isc->use_pio) {
- bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
- BUS_SPACE_BARRIER_READ);
-
/* Reset read pointer to the specified offset */
bus_space_write_2(sc->bt, sc->bh, IX_READPTR, offset);
- bus_space_barrier(sc->bt, sc->bh, IX_READPTR, 2,
- BUS_SPACE_BARRIER_WRITE);
return bus_space_read_2(sc->bt, sc->bh, IX_DATAPORT);
} else {
- bus_space_barrier(sc->bt, sc->bh, offset, 2,
- BUS_SPACE_BARRIER_READ);
return bus_space_read_2(sc->bt, sc->bh, offset);
}
}
@@ -382,16 +345,10 @@
if (isc->use_pio) {
/* Reset write pointer to the specified offset */
bus_space_write_2(sc->bt, sc->bh, IX_WRITEPTR, offset);
- bus_space_barrier(sc->bt, sc->bh, IX_WRITEPTR, 2,
- BUS_SPACE_BARRIER_WRITE);
bus_space_write_2(sc->bt, sc->bh, IX_DATAPORT, value);
- bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
- BUS_SPACE_BARRIER_WRITE);
} else {
bus_space_write_2(sc->bt, sc->bh, offset, value);
- bus_space_barrier(sc->bt, sc->bh, offset, 2,
- BUS_SPACE_BARRIER_WRITE);
}
}
@@ -405,20 +362,14 @@
if (isc->use_pio) {
/* Reset write pointer to the specified offset */
bus_space_write_2(sc->bt, sc->bh, IX_WRITEPTR, offset);
- bus_space_barrier(sc->bt, sc->bh, IX_WRITEPTR, 2,
- BUS_SPACE_BARRIER_WRITE);
ptr = (char*)&val;
bus_space_write_2(sc->bt, sc->bh, IX_DATAPORT,
Home |
Main Index |
Thread Index |
Old Index