[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen-unstable] qemu-xen: Clean pt-graphic, use defined value.



commit 9502c216ef2c5134edfbe5f7e80aa01fb59c3ac4
Author: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Date:   Thu Dec 1 18:23:07 2011 +0000

    qemu-xen: Clean pt-graphic, use defined value.
    
    Used defined value for 0x8086 (PCI_VENDOR_ID_INTEL) and some PCI config
    space offsets.
    
    Signed-off-by: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
---
 hw/pci.h         |    1 +
 hw/pt-graphics.c |   12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/hw/pci.h b/hw/pci.h
index e2c1fd8..edc58b6 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -169,6 +169,7 @@ typedef struct PCIIORegion {
 #define PCI_INTERRUPT_PIN      0x3d    /* 8 bits */
 #define PCI_MIN_GNT            0x3e    /* 8 bits */
 #define PCI_MAX_LAT            0x3f    /* 8 bits */
+#define PCI_INTEL_OPREGION     0xfc    /* 32 bits */
 
 /* Header type 1 (PCI-to-PCI bridges) */
 #define PCI_SEC_STATUS         0x1e    /* Secondary status register */
diff --git a/hw/pt-graphics.c b/hw/pt-graphics.c
index 73c5a43..6a485ce 100644
--- a/hw/pt-graphics.c
+++ b/hw/pt-graphics.c
@@ -32,7 +32,7 @@ void intel_pch_init(PCIBus *bus)
     did = pt_pci_host_read(pci_dev_1f, PCI_DEVICE_ID, 2);
     rid = pt_pci_host_read(pci_dev_1f, PCI_REVISION, 1);
 
-    if ( vid == 0x8086 ) 
+    if ( vid == PCI_VENDOR_ID_INTEL )
         pci_bridge_init(bus, PCI_DEVFN(0x1f, 0), vid, did, rid,
                         pch_map_irq, "intel_bridge_1f");
 }
@@ -117,8 +117,8 @@ int register_vga_regions(struct pt_dev *real_device)
 
     /* 1:1 map ASL Storage register value */
     vendor_id = pt_pci_host_read(real_device->pci_dev, 0, 2);
-    igd_opregion = pt_pci_host_read(real_device->pci_dev, 0xfc, 4);
-    if ( (vendor_id == 0x8086) && igd_opregion )
+    igd_opregion = pt_pci_host_read(real_device->pci_dev, PCI_INTEL_OPREGION, 
4);
+    if ( (vendor_id == PCI_VENDOR_ID_INTEL ) && igd_opregion )
     {
         ret |= xc_domain_memory_mapping(xc_handle, domid,
                 igd_opregion >> XC_PAGE_SHIFT,
@@ -157,9 +157,9 @@ int unregister_vga_regions(struct pt_dev *real_device)
             20,
             DPCI_REMOVE_MAPPING);
 
-    vendor_id = pt_pci_host_read(real_device->pci_dev, 0, 2);
-    igd_opregion = pt_pci_host_read(real_device->pci_dev, 0xfc, 4);
-    if ( (vendor_id == 0x8086) && igd_opregion )
+    vendor_id = pt_pci_host_read(real_device->pci_dev, PCI_VENDOR_ID, 2);
+    igd_opregion = pt_pci_host_read(real_device->pci_dev, PCI_INTEL_OPREGION, 
4);
+    if ( (vendor_id == PCI_VENDOR_ID_INTEL) && igd_opregion )
     {
         ret |= xc_domain_memory_mapping(xc_handle, domid,
                 igd_opregion >> XC_PAGE_SHIFT,
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.