From 3f5e19b4eece8b6a47fd254845fe9dd392fc5c72 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 10 Mar 2014 12:53:52 -0400 Subject: [PATCH] pci: Use #defines for PCI vendors. 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 ad84768dce..204343d99a 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 1373acb7df..65260f6da6 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 7589b64b60..742bc1862f 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 36e04486b5..c447e5a006 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 66d10f70d0..fd66238efb 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 0000000000..f5b1d94ddb --- /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 -- 2.39.5