PERFORCE change 73515 for review

Juli Mallett jmallett at FreeBSD.org
Sat Mar 19 02:45:05 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=73515

Change 73515 by jmallett at jmallett_windward on 2005/03/19 10:44:04

	Attach IMC at arcs_system.  Whee!

Affected files ...

.. //depot/projects/mips/sys/dev/arcs/arcs_system.c#3 edit
.. //depot/projects/mips/sys/mips/sgimips/imc/imc.c#12 edit

Differences ...

==== //depot/projects/mips/sys/dev/arcs/arcs_system.c#3 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/mips/sys/dev/arcs/arcs_system.c#2 $
+ * $P4: //depot/projects/mips/sys/dev/arcs/arcs_system.c#3 $
  */
 
 #include <sys/param.h>
@@ -63,10 +63,20 @@
 
 DRIVER_MODULE(arcs_system, arcs, arcs_system_driver, arcs_system_devclass, 0, 0);
 
+static struct mainbus_name {
+	const char *mn_system;
+	const char *mn_device;
+} mainbus_names[] = {
+	{ "SGI-IP22",  		"imc" },
+	{ NULL,			NULL }
+};
+
 static int
 arcs_system_probe(device_t dev)
 {
 	struct ARCS_Component *component, *child;
+	struct mainbus_name *mainbus;
+	const char *system;
 
 	component = device_get_softc(dev);
 	if (component == NULL)
@@ -82,5 +92,10 @@
 	/*
 	 * Attach busses for this system.
 	 */
+	system = arcs_component_identifier(component);
+	for (mainbus = mainbus_names; mainbus->mn_system != NULL; mainbus++) {
+		if (strcmp(mainbus->mn_system, system) == 0)
+			device_add_child(dev, mainbus->mn_device, -1);
+	}
 	return (0);
 }

==== //depot/projects/mips/sys/mips/sgimips/imc/imc.c#12 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/mips/sys/mips/sgimips/imc/imc.c#11 $
+ * $P4: //depot/projects/mips/sys/mips/sgimips/imc/imc.c#12 $
  */
 
 #include <sys/cdefs.h>
@@ -203,4 +203,4 @@
 	IMC_WRITE_4(port, IMC_GIO_ERRSTAT, 0);
 }
 
-DRIVER_MODULE(imc, mainbus, imc_driver, imc_devclass, 0, 0);
+DRIVER_MODULE(imc, arcs_system, imc_driver, imc_devclass, 0, 0);


More information about the p4-projects mailing list