summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sparc/sparc/legacy.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/sparc/sparc/legacy.c')
-rw-r--r--freebsd/sys/sparc/sparc/legacy.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/freebsd/sys/sparc/sparc/legacy.c b/freebsd/sys/sparc/sparc/legacy.c
index 2547990c..70bdcebc 100644
--- a/freebsd/sys/sparc/sparc/legacy.c
+++ b/freebsd/sys/sparc/sparc/legacy.c
@@ -61,7 +61,9 @@ __FBSDID("$FreeBSD$");
static MALLOC_DEFINE(M_LEGACYDEV, "legacydrv", "legacy system device");
struct legacy_device {
- int lg_pcibus;
+ int lg_pcibus;
+ int lg_pcislot;
+ int lg_pcifunc;
};
#define DEVTOAT(dev) ((struct legacy_device *)device_get_ivars(dev))
@@ -89,6 +91,7 @@ static device_method_t legacy_methods[] = {
DEVMETHOD(bus_read_ivar, legacy_read_ivar),
DEVMETHOD(bus_write_ivar, legacy_write_ivar),
DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
@@ -184,6 +187,8 @@ legacy_add_child(device_t bus, u_int order, const char *name, int unit)
if (atdev == NULL)
return(NULL);
atdev->lg_pcibus = -1;
+ atdev->lg_pcislot = -1;
+ atdev->lg_pcifunc = -1;
child = device_add_child_ordered(bus, order, name, unit);
if (child == NULL)
@@ -207,6 +212,12 @@ legacy_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
case LEGACY_IVAR_PCIBUS:
*result = atdev->lg_pcibus;
break;
+ case LEGACY_IVAR_PCISLOT:
+ *result = atdev->lg_pcislot;
+ break;
+ case LEGACY_IVAR_PCIFUNC:
+ *result = atdev->lg_pcifunc;
+ break;
default:
return ENOENT;
}
@@ -225,6 +236,12 @@ legacy_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
case LEGACY_IVAR_PCIBUS:
atdev->lg_pcibus = value;
break;
+ case LEGACY_IVAR_PCISLOT:
+ atdev->lg_pcislot = value;
+ break;
+ case LEGACY_IVAR_PCIFUNC:
+ atdev->lg_pcifunc = value;
+ break;
default:
return ENOENT;
}
@@ -260,19 +277,17 @@ static device_method_t cpu_methods[] = {
/* Bus interface */
DEVMETHOD(bus_add_child, cpu_add_child),
DEVMETHOD(bus_read_ivar, cpu_read_ivar),
- DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource),
DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
- DEVMETHOD(bus_driver_added, bus_generic_driver_added),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
- { 0, 0 }
+ DEVMETHOD_END
};
static driver_t cpu_driver = {
@@ -294,12 +309,11 @@ cpu_identify(driver_t *driver, device_t parent)
* so that these devices are attached after the Host-PCI
* bridges (which are added at order 100).
*/
- for (i = 0; i <= mp_maxid; i++)
- if (!CPU_ABSENT(i)) {
- child = BUS_ADD_CHILD(parent, 150, "cpu", i);
- if (child == NULL)
- panic("legacy_attach cpu");
- }
+ CPU_FOREACH(i) {
+ child = BUS_ADD_CHILD(parent, 150, "cpu", i);
+ if (child == NULL)
+ panic("legacy_attach cpu");
+ }
}
static device_t