PERFORCE change 94450 for review

John-Mark Gurney jmg at FreeBSD.org
Sun Apr 2 06:31:15 UTC 2006


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

Change 94450 by jmg at jmg_carbon-60 on 2006/04/02 06:31:02

	make comple..  support writing config registers..

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#8 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#8 (text+ko) ====

@@ -160,6 +160,7 @@
 	pci_config_size_t size;
 	pci_cfg_data_t data;
 	uint32_t ret;
+	int r;
 
 	sc = device_get_softc(dev);
 
@@ -211,11 +212,31 @@
      uint32_t val, int width)
 {
 	struct hvpci_softc *sc;
+	pci_config_size_t size;
+	pci_cfg_data_t data;
 	uint32_t err_flags;
 
 	sc = device_get_softc(dev);
+
+	switch (width) {
+	case 1:
+		size = PCI_CFG_SIZE_BYTE;
+		data.b = val;
+		break;
+	case 2:
+		size = PCI_CFG_SIZE_WORD;
+		data.w = val;
+		break;
+	case 4:
+		size = PCI_CFG_SIZE_DWORD;
+		data.dw = val;
+		break;
+	default:
+		panic("unsupported width: %d", width);
+	}
+
 	hvio_config_put(sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg,
-			width, val, &err_flags);
+			size, data, &err_flags);
 }
 
 #ifdef notyet


More information about the p4-projects mailing list