/root/src/xen/xen/arch/x86/x86_64/mmconfig.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2006, Intel Corporation. |
3 | | * |
4 | | * This program is free software; you can redistribute it and/or modify it |
5 | | * under the terms and conditions of the GNU General Public License, |
6 | | * version 2, as published by the Free Software Foundation. |
7 | | * |
8 | | * This program is distributed in the hope it will be useful, but WITHOUT |
9 | | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
10 | | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
11 | | * more details. |
12 | | * |
13 | | * You should have received a copy of the GNU General Public License along with |
14 | | * this program; If not, see <http://www.gnu.org/licenses/>. |
15 | | * |
16 | | * Author: Allen Kay <allen.m.kay@intel.com> - adapted from linux |
17 | | */ |
18 | | |
19 | | #define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 |
20 | | #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 |
21 | | |
22 | | /* ioport ends */ |
23 | | #define PCI_PROBE_BIOS 0x0001 |
24 | | #define PCI_PROBE_CONF1 0x0002 |
25 | | #define PCI_PROBE_CONF2 0x0004 |
26 | 3 | #define PCI_PROBE_MMCONF 0x0008 |
27 | 2 | #define PCI_PROBE_MASK 0x000f |
28 | | #define PCI_PROBE_NOEARLY 0x0010 |
29 | | |
30 | 0 | #define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000 |
31 | | |
32 | | extern unsigned int pci_probe; |
33 | | |
34 | | /* |
35 | | * AMD Fam10h CPUs are buggy, and cannot access MMIO config space |
36 | | * on their northbrige except through the * %eax register. As such, you MUST |
37 | | * NOT use normal IOMEM accesses, you need to only use the magic mmio-config |
38 | | * accessor functions. |
39 | | * In fact just use pci_config_*, nothing else please. |
40 | | */ |
41 | | static inline unsigned char mmio_config_readb(void __iomem *pos) |
42 | 0 | { |
43 | 0 | u8 val; |
44 | 0 | asm volatile("movb (%1),%%al" : "=a" (val) : "r" (pos)); |
45 | 0 | return val; |
46 | 0 | } Unexecuted instantiation: physdev.c:mmio_config_readb Unexecuted instantiation: mmconfig-shared.c:mmio_config_readb Unexecuted instantiation: mmconfig_64.c:mmio_config_readb Unexecuted instantiation: mmconf-fam10h.c:mmio_config_readb Unexecuted instantiation: acpi_mmcfg.c:mmio_config_readb Unexecuted instantiation: emul-priv-op.c:mmio_config_readb |
47 | | |
48 | | static inline unsigned short mmio_config_readw(void __iomem *pos) |
49 | 0 | { |
50 | 0 | u16 val; |
51 | 0 | asm volatile("movw (%1),%%ax" : "=a" (val) : "r" (pos)); |
52 | 0 | return val; |
53 | 0 | } Unexecuted instantiation: physdev.c:mmio_config_readw Unexecuted instantiation: emul-priv-op.c:mmio_config_readw Unexecuted instantiation: acpi_mmcfg.c:mmio_config_readw Unexecuted instantiation: mmconf-fam10h.c:mmio_config_readw Unexecuted instantiation: mmconfig_64.c:mmio_config_readw Unexecuted instantiation: mmconfig-shared.c:mmio_config_readw |
54 | | |
55 | | static inline unsigned int mmio_config_readl(void __iomem *pos) |
56 | 2 | { |
57 | 2 | u32 val; |
58 | 2 | asm volatile("movl (%1),%%eax" : "=a" (val) : "r" (pos)); |
59 | 2 | return val; |
60 | 2 | } Unexecuted instantiation: physdev.c:mmio_config_readl Unexecuted instantiation: emul-priv-op.c:mmio_config_readl Unexecuted instantiation: acpi_mmcfg.c:mmio_config_readl Unexecuted instantiation: mmconf-fam10h.c:mmio_config_readl mmconfig_64.c:mmio_config_readl Line | Count | Source | 56 | 2 | { | 57 | 2 | u32 val; | 58 | 2 | asm volatile("movl (%1),%%eax" : "=a" (val) : "r" (pos)); | 59 | 2 | return val; | 60 | 2 | } |
Unexecuted instantiation: mmconfig-shared.c:mmio_config_readl |
61 | | |
62 | | static inline void mmio_config_writeb(void __iomem *pos, u8 val) |
63 | 0 | { |
64 | 0 | asm volatile("movb %%al,(%1)" :: "a" (val), "r" (pos) : "memory"); |
65 | 0 | } Unexecuted instantiation: mmconfig-shared.c:mmio_config_writeb Unexecuted instantiation: mmconfig_64.c:mmio_config_writeb Unexecuted instantiation: mmconf-fam10h.c:mmio_config_writeb Unexecuted instantiation: acpi_mmcfg.c:mmio_config_writeb Unexecuted instantiation: emul-priv-op.c:mmio_config_writeb Unexecuted instantiation: physdev.c:mmio_config_writeb |
66 | | |
67 | | static inline void mmio_config_writew(void __iomem *pos, u16 val) |
68 | 0 | { |
69 | 0 | asm volatile("movw %%ax,(%1)" :: "a" (val), "r" (pos) : "memory"); |
70 | 0 | } Unexecuted instantiation: physdev.c:mmio_config_writew Unexecuted instantiation: emul-priv-op.c:mmio_config_writew Unexecuted instantiation: mmconfig-shared.c:mmio_config_writew Unexecuted instantiation: mmconfig_64.c:mmio_config_writew Unexecuted instantiation: mmconf-fam10h.c:mmio_config_writew Unexecuted instantiation: acpi_mmcfg.c:mmio_config_writew |
71 | | |
72 | | static inline void mmio_config_writel(void __iomem *pos, u32 val) |
73 | 0 | { |
74 | 0 | asm volatile("movl %%eax,(%1)" :: "a" (val), "r" (pos) : "memory"); |
75 | 0 | } Unexecuted instantiation: emul-priv-op.c:mmio_config_writel Unexecuted instantiation: mmconfig-shared.c:mmio_config_writel Unexecuted instantiation: mmconfig_64.c:mmio_config_writel Unexecuted instantiation: physdev.c:mmio_config_writel Unexecuted instantiation: acpi_mmcfg.c:mmio_config_writel Unexecuted instantiation: mmconf-fam10h.c:mmio_config_writel |
76 | | |
77 | | /* function prototypes */ |
78 | | int acpi_parse_mcfg(struct acpi_table_header *header); |
79 | | int pci_mmcfg_reserved(uint64_t address, unsigned int segment, |
80 | | unsigned int start_bus, unsigned int end_bus, |
81 | | unsigned int flags); |
82 | | int pci_mmcfg_arch_init(void); |
83 | | int pci_mmcfg_arch_enable(unsigned int); |
84 | | void pci_mmcfg_arch_disable(unsigned int); |