From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH v3 5/6] pci: Use #defines for PCI vendors. Date: Wed, 12 Mar 2014 11:27:51 -0400 Message-ID: <1394638072-11331-6-git-send-email-konrad.wilk@oracle.com> References: <1394638072-11331-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNl45-0000mk-4Q for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 15:27:29 +0000 Received: by mail-qg0-f45.google.com with SMTP id j5so29515591qga.4 for ; Wed, 12 Mar 2014 08:27:26 -0700 (PDT) In-Reply-To: <1394638072-11331-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: andrew.cooper3@citrix.com, aravind.gopalakrishnan@amd.com, xen-devel@lists.xenproject.org, jbeulich@suse.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org Instead of having hard-coded values. We only do PCI vendors as Jan requested and put all PCI device vendors in one new file. Signed-off-by: Konrad Rzeszutek Wilk [v1: Sorted them based on their numerical values per Jan's review] Suggested-by: Andrew Cooper Reviewed-by: Jan Beulich --- xen/arch/x86/oprofile/op_model_athlon.c | 4 ++-- xen/arch/x86/x86_64/mmconf-fam10h.c | 1 + xen/arch/x86/x86_64/mmconfig-shared.c | 1 + xen/arch/x86/x86_64/mmconfig.h | 4 ---- xen/drivers/char/ns16550.c | 5 +++-- xen/include/xen/pci_ids.h | 9 +++++++++ 6 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 xen/include/xen/pci_ids.h diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c index ad84768..204343d 100644 --- a/xen/arch/x86/oprofile/op_model_athlon.c +++ b/xen/arch/x86/oprofile/op_model_athlon.c @@ -20,7 +20,8 @@ #include #include #include - +#include + #include "op_x86_model.h" #include "op_counter.h" @@ -445,7 +446,6 @@ static inline void __init init_ibs_nmi_per_cpu(void *arg) apic_write(reg, APIC_EILVT_MSG_NMI << 8); } -#define PCI_VENDOR_ID_AMD 0x1022 #define PCI_DEVICE_ID_AMD_10H_NB_MISC 0x1203 #define IBSCTL 0x1cc static int __init init_ibs_nmi(void) diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c index 1373acb..65260f6 100644 --- a/xen/arch/x86/x86_64/mmconf-fam10h.c +++ b/xen/arch/x86/x86_64/mmconf-fam10h.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c index 7589b64..742bc18 100644 --- a/xen/arch/x86/x86_64/mmconfig-shared.c +++ b/xen/arch/x86/x86_64/mmconfig-shared.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h index 36e0448..c447e5a 100644 --- a/xen/arch/x86/x86_64/mmconfig.h +++ b/xen/arch/x86/x86_64/mmconfig.h @@ -17,7 +17,6 @@ * Author: Allen Kay - adapted from linux */ -#define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 @@ -29,11 +28,8 @@ #define PCI_PROBE_MASK 0x000f #define PCI_PROBE_NOEARLY 0x0010 -#define PCI_VENDOR_ID_AMD 0x1022 #define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000 -#define PCI_VENDOR_ID_NVIDIA 0x10de - extern unsigned int pci_probe; /* diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 66d10f7..fd66238 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -19,6 +19,7 @@ #ifdef HAS_PCI #include #include +#include #endif #include #include @@ -135,13 +136,13 @@ static const struct ns16550_config_mmio __initconst uart_config[] = { /* Broadcom TruManage device */ { - .vendor_id = 0x14e4, + .vendor_id = PCI_VENDOR_ID_BROADCOM, .dev_id = 0x160a, .param = param_trumanage, }, /* OXPCIe952 1 Native UART */ { - .vendor_id = 0x1415, + .vendor_id = PCI_VENDOR_ID_OXSEMI, .dev_id = 0xc138, .param = param_oxford, } diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h new file mode 100644 index 0000000..f5b1d94 --- /dev/null +++ b/xen/include/xen/pci_ids.h @@ -0,0 +1,9 @@ +#define PCI_VENDOR_ID_AMD 0x1022 + +#define PCI_VENDOR_ID_NVIDIA 0x10de + +#define PCI_VENDOR_ID_OXSEMI 0x1415 + +#define PCI_VENDOR_ID_BROADCOM 0x14e4 + +#define PCI_VENDOR_ID_INTEL 0x8086 -- 1.7.7.6