PERFORCE change 94453 for review

John-Mark Gurney jmg at FreeBSD.org
Sun Apr 2 08:19:32 UTC 2006


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

Change 94453 by jmg at jmg_carbon-60 on 2006/04/02 08:19:24

	remove the enum size stuff, turned out that wasn't a good idea..

Affected files ...

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

Differences ...

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

@@ -157,29 +157,14 @@
     int width)
 {
 	struct hvpci_softc *sc;
-	pci_config_size_t size;
 	uint32_t data;
 	uint32_t ret;
 	int r;
 
 	sc = device_get_softc(dev);
 
-	switch (width) {
-	case 1:
-		size = PCI_CFG_SIZE_BYTE;
-		break;
-	case 2:
-		size = PCI_CFG_SIZE_WORD;
-		break;
-	case 4:
-		size = PCI_CFG_SIZE_DWORD;
-		break;
-	default:
-		panic("unsupported width: %d", width);
-	}
-
 	r = hvio_config_get(sc->hs_devhandle, HVPCI_BDF(bus, slot, func),
-	    reg, size, &data);
+	    reg, width, &data);
 
 	printf("%d = read_config(%#x, %#x, %d, %d) = %#x\n", r,
 	    sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg, width, data);
@@ -212,7 +197,6 @@
      uint32_t val, int width)
 {
 	struct hvpci_softc *sc;
-	pci_config_size_t size;
 	uint32_t data;
 	uint32_t err_flags;
 
@@ -220,15 +204,12 @@
 
 	switch (width) {
 	case 1:
-		size = PCI_CFG_SIZE_BYTE;
 		*(uint8_t *)&data = val;
 		break;
 	case 2:
-		size = PCI_CFG_SIZE_WORD;
 		*(uint16_t *)&data = val;
 		break;
 	case 4:
-		size = PCI_CFG_SIZE_DWORD;
 		data = val;
 		break;
 	default:
@@ -236,7 +217,7 @@
 	}
 
 	hvio_config_put(sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg,
-			size, data, &err_flags);
+			width, data, &err_flags);
 }
 
 #ifdef notyet


More information about the p4-projects mailing list