From: Jean Guyader Date: Thu, 1 Dec 2011 18:23:07 +0000 (+0000) Subject: qemu-xen: Clean pt-graphic, use defined value. X-Git-Tag: xen-4.2.0-rc1~29 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9502c216ef2c5134edfbe5f7e80aa01fb59c3ac4;p=qemu-xen-4.5-testing.git 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 --- diff --git a/hw/pci.h b/hw/pci.h index e2c1fd865..edc58b666 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 73c5a43e3..6a485ce9e 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,