Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Apr 2006 06:31:14 GMT
From:      John-Mark Gurney <jmg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 94450 for review
Message-ID:  <200604020631.k326VEV2014170@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=94450

Change 94450 by jmg@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604020631.k326VEV2014170>