From: Jean Guyader Subject: [PATCH 2/3] qemu-xen: Clean pt-graphic, use defined value. Date: Wed, 23 Nov 2011 13:51:58 +0000 Message-ID: <1322056319-19725-2-git-send-email-jean.guyader@eu.citrix.com> References: <1322056319-19725-1-git-send-email-jean.guyader@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------true" Return-path: In-Reply-To: <1322056319-19725-1-git-send-email-jean.guyader@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: allen.m.kay@intel.com, Ian.Jackson@eu.citrix.com, Jean Guyader List-Id: xen-devel@lists.xenproject.org --------------true Content-Type: text/plain; charset="UTF-8"; format=fixed Content-Transfer-Encoding: 8bit Used defined value for 0x8086 (PCI_VENDOR_ID_INTEL) and some PCI config space offsets. Signed-off-by: Jean Guyader --- hw/pci.h | 1 + hw/pt-graphics.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) --------------true Content-Type: text/x-patch; name="0002-qemu-xen-Clean-pt-graphic-use-defined-value.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0002-qemu-xen-Clean-pt-graphic-use-defined-value.patch" 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, --------------true Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------true--