Remove the compat shims for the ISA old-stlye in{b,w,l}()/out{b,w,l}()

and friends along with all hacks required to implement them. None of
the drivers currently built (as part of GENERIC, LINT or modules) on
sparc64 or sun4v and none of those we might want to use there in
future uses them, AFAICT there actually never was a driver hooked up
to the sparc64 or sun4v build that correctly used these functions
(and it looks like that due to a bug read{b,w,l}()/write{b,w,l}() and
the other functions working on a memory handle never actually worked on
sun4v). All they ever were good for on sparc64 and sun4v was erroneously
dragging in dependencies on isa(4) in drivers like f.e. dpt(4), si(4)
and syscons(4) in source files that supposedly were bus-neutral and
hiding issues with drivers like f.e. ng_bt3c(4) that used these
functions with busses other than isa(4) and therefore couldn't work on
these platforms.
This commit is contained in:
Marius Strobl 2007-01-18 13:52:44 +00:00
parent 420a38dd4b
commit 441b9412d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166092
6 changed files with 0 additions and 189 deletions

View File

@ -845,59 +845,6 @@ bus_space_peek_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
return (fasword32(bus_type_asi[t->bst_type], (caddr_t)(h + o), a));
}
/* Back-compat functions for old ISA drivers */
extern bus_space_tag_t isa_io_bt;
extern bus_space_handle_t isa_io_hdl;
extern bus_space_tag_t isa_mem_bt;
extern bus_space_handle_t isa_mem_hdl;
#define inb(o) bus_space_read_1(isa_io_bt, isa_io_hdl, o)
#define inw(o) bus_space_read_2(isa_io_bt, isa_io_hdl, o)
#define inl(o) bus_space_read_4(isa_io_bt, isa_io_hdl, o)
#define outb(o, v) bus_space_write_1(isa_io_bt, isa_io_hdl, o, v)
#define outw(o, v) bus_space_write_2(isa_io_bt, isa_io_hdl, o, v)
#define outl(o, v) bus_space_write_4(isa_io_bt, isa_io_hdl, o, v)
#define readb(o) bus_space_read_1(isa_mem_bt, isa_mem_hdl, o)
#define readw(o) bus_space_read_2(isa_mem_bt, isa_mem_hdl, o)
#define readl(o) bus_space_read_4(isa_mem_bt, isa_mem_hdl, o)
#define writeb(o, v) bus_space_write_1(isa_mem_bt, isa_mem_hdl, o, v)
#define writew(o, v) bus_space_write_2(isa_mem_bt, isa_mem_hdl, o, v)
#define writel(o, v) bus_space_write_4(isa_mem_bt, isa_mem_hdl, o, v)
#define insb(o, a, c) \
bus_space_read_multi_1(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define insw(o, a, c) \
bus_space_read_multi_2(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define insl(o, a, c) \
bus_space_read_multi_4(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define outsb(o, a, c) \
bus_space_write_multi_1(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define outsw(o, a, c) \
bus_space_write_multi_2(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define outsl(o, a, c) \
bus_space_write_multi_4(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define memcpy_fromio(d, s, c) \
bus_space_read_region_1(isa_mem_bt, isa_mem_hdl, s, d, c)
#define memcpy_toio(d, s, c) \
bus_space_write_region_1(isa_mem_bt, isa_mem_hdl, d, s, c)
#define memcpy_io(d, s, c) \
bus_space_copy_region_1(isa_mem_bt, isa_mem_hdl, s, isa_mem_hdl, d, c)
#define memset_io(d, v, c) \
bus_space_set_region_1(isa_mem_bt, isa_mem_hdl, d, v, c)
#define memsetw_io(d, v, c) \
bus_space_set_region_2(isa_mem_bt, isa_mem_hdl, d, v, c)
static __inline void
memsetw(void *d, int val, size_t size)
{
u_int16_t *sp = d;
while (size--)
*sp++ = val;
}
#include <machine/bus_dma.h>
#endif /* !_MACHINE_BUS_H_ */

View File

@ -54,11 +54,6 @@ __FBSDID("$FreeBSD$");
#include <sparc64/isa/ofw_isa.h>
/* There can be only one ISA bus, so it is safe to use globals. */
bus_space_tag_t isa_io_bt = NULL;
bus_space_handle_t isa_io_hdl;
bus_space_tag_t isa_mem_bt = NULL;
bus_space_handle_t isa_mem_hdl;
static u_int64_t isa_io_base;
static u_int64_t isa_io_limit;
static u_int64_t isa_mem_base;
@ -139,15 +134,11 @@ isa_init(device_t dev)
/* This is probably always 0. */
isa_io_base = ISAB_RANGE_PHYS(&isab_ranges[i]);
isa_io_limit = isab_ranges[i].size;
isa_io_hdl = OFW_PCI_GET_BUS_HANDLE(bridge,
SYS_RES_IOPORT, isa_io_base, &isa_io_bt);
break;
case ISAR_SPACE_MEM:
/* This is probably always 0. */
isa_mem_base = ISAB_RANGE_PHYS(&isab_ranges[i]);
isa_mem_limit = isab_ranges[i].size;
isa_mem_hdl = OFW_PCI_GET_BUS_HANDLE(bridge,
SYS_RES_MEMORY, isa_mem_base, &isa_mem_bt);
break;
}
}
@ -359,14 +350,10 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
base = limit = 0;
switch (type) {
case SYS_RES_MEMORY:
if (isa_mem_bt == NULL)
return (NULL);
base = isa_mem_base;
limit = base + isa_mem_limit;
break;
case SYS_RES_IOPORT:
if (isa_io_bt == NULL)
return (NULL);
base = isa_io_base;
limit = base + isa_io_limit;
break;

View File

@ -25,7 +25,6 @@
# $FreeBSD$
#include <sys/bus.h>
#include <machine/bus.h>
#include <dev/ofw/openfirm.h>
@ -35,7 +34,6 @@ INTERFACE ofw_pci;
CODE {
static ofw_pci_intr_pending_t ofw_pci_default_intr_pending;
static ofw_pci_get_bus_handle_t ofw_pci_default_get_bus_handle;
static ofw_pci_adjust_busrange_t ofw_pci_default_adjust_busrange;
static int
@ -45,15 +43,6 @@ CODE {
return (OFW_PCI_INTR_PENDING(device_get_parent(dev), intr));
}
static bus_space_handle_t
ofw_pci_default_get_bus_handle(device_t dev, int type,
bus_space_handle_t childhdl, bus_space_tag_t *tag)
{
return (OFW_PCI_GET_BUS_HANDLE(device_get_parent(dev), type,
childhdl, tag));
}
static void
ofw_pci_default_adjust_busrange(device_t dev, u_int busno)
{
@ -68,16 +57,6 @@ METHOD int intr_pending {
ofw_pci_intr_t intr;
} DEFAULT ofw_pci_default_intr_pending;
# Get the bustag for the root bus. This is needed for ISA old-stlye
# in[bwl]()/out[bwl]() support, where no tag retrieved from a resource is
# passed. The returned tag is used to construct a tag for the whole ISA bus.
METHOD bus_space_handle_t get_bus_handle {
device_t dev;
int type;
bus_space_handle_t childhdl;
bus_space_tag_t *tag;
} DEFAULT ofw_pci_default_get_bus_handle;
# Make sure that all PCI bridges up in the hierarchy contain this bus in their
# subordinate bus range. This is required because we reenumerate all PCI
# buses.

View File

@ -117,7 +117,6 @@ static pcib_read_config_t psycho_read_config;
static pcib_write_config_t psycho_write_config;
static pcib_route_interrupt_t psycho_route_interrupt;
static ofw_pci_intr_pending_t psycho_intr_pending;
static ofw_pci_get_bus_handle_t psycho_get_bus_handle;
static ofw_bus_get_node_t psycho_get_node;
static ofw_pci_adjust_busrange_t psycho_adjust_busrange;
@ -150,7 +149,6 @@ static device_method_t psycho_methods[] = {
/* ofw_pci interface */
DEVMETHOD(ofw_pci_intr_pending, psycho_intr_pending),
DEVMETHOD(ofw_pci_get_bus_handle, psycho_get_bus_handle),
DEVMETHOD(ofw_pci_adjust_busrange, psycho_adjust_busrange),
{ 0, 0 }
@ -1278,25 +1276,6 @@ psycho_intr_pending(device_t dev, ofw_pci_intr_t intr)
return (diag != 0);
}
static bus_space_handle_t
psycho_get_bus_handle(device_t dev, int type, bus_space_handle_t childhdl,
bus_space_tag_t *tag)
{
struct psycho_softc *sc;
sc = device_get_softc(dev);
switch (type) {
case SYS_RES_IOPORT:
*tag = sc->sc_pci_iot;
return (sc->sc_pci_bh[OFW_PCI_CS_IO] + childhdl);
case SYS_RES_MEMORY:
*tag = sc->sc_pci_memt;
return (sc->sc_pci_bh[OFW_PCI_CS_MEM32] + childhdl);
default:
panic("%s: illegal space (%d)\n", __func__, type);
}
}
static phandle_t
psycho_get_node(device_t bus, device_t dev)
{

View File

@ -837,59 +837,6 @@ bus_space_copy_region_stream_8(bus_space_tag_t t, bus_space_handle_t h1,
bus_space_write_stream_8(t, h1, o1, bus_space_read_8(t, h2, o2));
}
/* Back-compat functions for old ISA drivers */
extern bus_space_tag_t isa_io_bt;
extern bus_space_handle_t isa_io_hdl;
extern bus_space_tag_t isa_mem_bt;
extern bus_space_handle_t isa_mem_hdl;
#define inb(o) bus_space_read_1(isa_io_bt, isa_io_hdl, o)
#define inw(o) bus_space_read_2(isa_io_bt, isa_io_hdl, o)
#define inl(o) bus_space_read_4(isa_io_bt, isa_io_hdl, o)
#define outb(o, v) bus_space_write_1(isa_io_bt, isa_io_hdl, o, v)
#define outw(o, v) bus_space_write_2(isa_io_bt, isa_io_hdl, o, v)
#define outl(o, v) bus_space_write_4(isa_io_bt, isa_io_hdl, o, v)
#define readb(o) bus_space_read_1(isa_mem_bt, isa_mem_hdl, o)
#define readw(o) bus_space_read_2(isa_mem_bt, isa_mem_hdl, o)
#define readl(o) bus_space_read_4(isa_mem_bt, isa_mem_hdl, o)
#define writeb(o, v) bus_space_write_1(isa_mem_bt, isa_mem_hdl, o, v)
#define writew(o, v) bus_space_write_2(isa_mem_bt, isa_mem_hdl, o, v)
#define writel(o, v) bus_space_write_4(isa_mem_bt, isa_mem_hdl, o, v)
#define insb(o, a, c) \
bus_space_read_multi_1(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define insw(o, a, c) \
bus_space_read_multi_2(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define insl(o, a, c) \
bus_space_read_multi_4(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define outsb(o, a, c) \
bus_space_write_multi_1(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define outsw(o, a, c) \
bus_space_write_multi_2(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define outsl(o, a, c) \
bus_space_write_multi_4(isa_io_bt, isa_io_hdl, o, (void*)a, c)
#define memcpy_fromio(d, s, c) \
bus_space_read_region_1(isa_mem_bt, isa_mem_hdl, s, d, c)
#define memcpy_toio(d, s, c) \
bus_space_write_region_1(isa_mem_bt, isa_mem_hdl, d, s, c)
#define memcpy_io(d, s, c) \
bus_space_copy_region_1(isa_mem_bt, isa_mem_hdl, s, isa_mem_hdl, d, c)
#define memset_io(d, v, c) \
bus_space_set_region_1(isa_mem_bt, isa_mem_hdl, d, v, c)
#define memsetw_io(d, v, c) \
bus_space_set_region_2(isa_mem_bt, isa_mem_hdl, d, v, c)
static __inline void
memsetw(void *d, int val, size_t size)
{
u_int16_t *sp = d;
while (size--)
*sp++ = val;
}
#include <machine/bus_dma.h>
#endif /* !_MACHINE_BUS_H_ */

View File

@ -86,7 +86,6 @@ static pcib_write_config_t hvpci_write_config;
static pcib_route_interrupt_t hvpci_route_interrupt;
static ofw_bus_get_node_t hvpci_get_node;
static ofw_pci_intr_pending_t hvpci_intr_pending;
static ofw_pci_get_bus_handle_t hvpci_get_bus_handle;
static device_method_t hv_pcib_methods[] = {
/* Device interface */
@ -119,7 +118,6 @@ static device_method_t hv_pcib_methods[] = {
/* ofw_pci interface */
DEVMETHOD(ofw_pci_intr_pending, hvpci_intr_pending),
DEVMETHOD(ofw_pci_get_bus_handle, hvpci_get_bus_handle),
{ 0, 0 }
};
@ -365,32 +363,6 @@ hvpci_intr_pending(device_t dev, ofw_pci_intr_t intr)
panic("unimplemnted");
}
static bus_space_handle_t
hvpci_get_bus_handle(device_t dev, int type, bus_space_handle_t childhdl,
bus_space_tag_t *tag)
{
struct hvpci_softc *sc;
sc = device_get_softc(dev);
switch (type) {
case SYS_RES_IOPORT:
*tag = sc->hs_pci_iot;
#ifdef DEBUG
printf("io handle: %#lx\n", sc->hs_pci_ioh + childhdl);
#endif
return (sc->hs_pci_ioh + childhdl);
break;
case SYS_RES_MEMORY:
*tag = sc->hs_pci_memt;
return (sc->hs_pci_ioh + childhdl);
break;
default:
panic("%s: illegal space (%d)", __func__, type);
}
}
static int
hvpci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
{