summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pciaccess_private.h3
-rw-r--r--src/solx_devfs.c19
2 files changed, 22 insertions, 0 deletions
diff --git a/src/pciaccess_private.h b/src/pciaccess_private.h
index fea9c9f..339ec0f 100644
--- a/src/pciaccess_private.h
+++ b/src/pciaccess_private.h
@@ -146,6 +146,9 @@ struct pci_device_private {
struct pci_device_mapping *mappings;
unsigned num_mappings;
/*@}*/
+#ifdef __sun
+ int is_primary;
+#endif
};
diff --git a/src/solx_devfs.c b/src/solx_devfs.c
index bb97f56..b096d7e 100644
--- a/src/solx_devfs.c
+++ b/src/solx_devfs.c
@@ -796,10 +796,13 @@ pci_device_solx_devfs_probe( struct pci_device * dev )
}
if (args.node != DI_NODE_NIL) {
+ int *prop;
#ifdef __sparc
di_minor_t minor;
#endif
+ priv->is_primary = 0;
+
#ifdef __sparc
if (minor = di_minor_next(args.node, DI_MINOR_NIL))
MAPPING_DEV_PATH(dev) = di_devfs_minor_path (minor);
@@ -807,6 +810,12 @@ pci_device_solx_devfs_probe( struct pci_device * dev )
MAPPING_DEV_PATH(dev) = NULL;
#endif
+ if (di_prop_lookup_ints(DDI_DEV_T_ANY, args.node,
+ "primary-controller", &prop) >= 1) {
+ if (prop[0])
+ priv->is_primary = 1;
+ }
+
/*
* It will succeed for sure, because it was
* successfully called in find_target_node
@@ -1131,6 +1140,15 @@ pci_device_solx_devfs_write( struct pci_device * dev, const void * data,
return (err);
}
+static int pci_device_solx_devfs_boot_vga(struct pci_device *dev)
+{
+ struct pci_device_private *priv =
+ (struct pci_device_private *) dev;
+
+ return (priv->is_primary);
+
+}
+
static struct pci_io_handle *
pci_device_solx_devfs_open_legacy_io(struct pci_io_handle *ret,
struct pci_device *dev,
@@ -1263,6 +1281,7 @@ static const struct pci_system_methods solx_devfs_methods = {
.write = pci_device_solx_devfs_write,
.fill_capabilities = pci_fill_capabilities_generic,
+ .boot_vga = pci_device_solx_devfs_boot_vga,
.open_legacy_io = pci_device_solx_devfs_open_legacy_io,
.read32 = pci_device_solx_devfs_read32,