PERFORCE change 94652 for review
John-Mark Gurney
jmg at FreeBSD.org
Wed Apr 5 00:37:56 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94652
Change 94652 by jmg at jmg_arlene on 2006/04/05 00:37:00
make compile.. pulling in ofw_pci_if.m for a define for ranges...
make asi fetch/store work
make hv_pci.c compile...
Affected files ...
.. //depot/projects/kmacy_sun4v/src/sys/conf/files.sun4v#11 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/bus.h#6 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/cpufunc.h#6 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#20 edit
Differences ...
==== //depot/projects/kmacy_sun4v/src/sys/conf/files.sun4v#11 (text+ko) ====
@@ -52,6 +52,7 @@
eeprom sbus
sun4v/sun4v/gdb_machdep.c optional gdb
sun4v/sun4v/hv_pci.c optional pci
+sparc64/pci/ofw_pci_if.m optional pci
# XXX hvcons should be optional
sun4v/sun4v/hvcons.c standard
sun4v/sun4v/hcall.S standard
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/bus.h#6 (text+ko) ====
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/cpufunc.h#6 (text+ko) ====
@@ -116,7 +116,7 @@
#define lduwa(va, asi) LD_GENERIC(va, asi, lduwa, u_int)
#define ldxa(va, asi) LD_GENERIC(va, asi, ldxa, u_long)
-#if 1
+#if 0
#define STNC_GEN(tp, o) \
static __inline void \
o ## _nc(caddr_t va, int asi, tp val) \
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#20 (text+ko) ====
@@ -38,23 +38,23 @@
#include <sys/module.h>
#include <sys/pcpu.h>
#include <sys/endian.h>
+#include <sys/rman.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <machine/bus.h>
-#include <sparc64/pci/ofw_pci.h>
#include <machine/hypervisor_api.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/openfirm.h>
+#include <sparc64/pci/ofw_pci.h>
#include <machine/hv_pcivar.h>
#include "pcib_if.h"
-#include <sys/rman.h>
#define SUN4V_REG_SPEC2CFG_HDL(x) ((x >> 32) & ~(0xfull << 28))
/*
* XXX - should get this through the bus, but Sun overloaded the reg OFW
@@ -146,7 +146,7 @@
uint64_t reg, nreg;
int br[2];
int n, type;
- int i, nrange, rid;
+ int i, nrange;
sc = device_get_softc(dev);
@@ -163,7 +163,7 @@
sc->hs_busnum = br[0];
/* Setup the HyperVisor devhandle for this bus */
-#if 1
+#if 0
if (OF_getprop(node, "reg", &cell, sizeof cell) == -1)
panic("%s: OF_getprop failed.", __func__);
sc->hs_devhandle = cell & 0xfffffff;
@@ -214,8 +214,8 @@
*btp = (bus_space_tag_t)malloc(sizeof **btp, M_DEVBUF,
M_WAITOK|M_ZERO);
- btp->bst_parent = &nexus_bustag;
- btp->bst_type = type;
+ (*btp)->bst_parent = &nexus_bustag;
+ (*btp)->bst_type = type;
}
device_add_child(dev, "pci", -1);
@@ -383,21 +383,21 @@
bus_space_handle_t bh;
int needactivate;
- sc = device_get_softc(dev);
+ sc = device_get_softc(bus);
needactivate = flags & RF_ACTIVE;
flags &= ~RF_ACTIVE;
switch (type) {
case SYS_RES_MEMORY:
- rm = &sc->sc_pci_mem_rman;
- bt = sc->sc_pci_memt;
- bh = sc->sc_pci_memh;
+ rm = &sc->hs_pci_mem_rman;
+ bt = sc->hs_pci_memt;
+ bh = sc->hs_pci_memh;
break;
case SYS_RES_IOPORT:
- rm = &sc->sc_pci_io_rman;
- bt = sc->sc_pci_iot;
- bh = sc->sc_pci_ioh;
+ rm = &sc->hs_pci_io_rman;
+ bt = sc->hs_pci_iot;
+ bh = sc->hs_pci_ioh;
break;
default:
return (NULL);
@@ -425,6 +425,7 @@
hvpci_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
+#if 0
void *p;
int error;
@@ -440,6 +441,9 @@
rman_set_virtual(r, p);
}
return (rman_activate_resource(r));
+#else
+ return (ENXIO);
+#endif
}
static int
More information about the p4-projects
mailing list