]> xenbits.xensource.com Git - qemu-xen-4.2-testing.git/commitdiff
qemu-xen: Clean pt-graphic, use defined value.
authorJean Guyader <jean.guyader@eu.citrix.com>
Thu, 1 Dec 2011 18:23:07 +0000 (18:23 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 1 Dec 2011 18:23:07 +0000 (18:23 +0000)
Used defined value for 0x8086 (PCI_VENDOR_ID_INTEL) and some PCI config
space offsets.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
hw/pci.h
hw/pt-graphics.c

index e2c1fd865c5bb9aa3e9bec5579413a238431b0a8..edc58b6663cbf298e71636177ea66e91ce380248 100644 (file)
--- 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 */
index 73c5a43e397848fd1e2139fa356cc0c0b6d0b60c..6a485ce9e60743f8e14f7ac8c4fb758e700d2fe7 100644 (file)
@@ -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,