x64, x2apic/intr-remap: Queued invalidation infrastructure (part of VT-d)
[deliverable/linux.git] / include / linux / dmar.h
CommitLineData
10e5247f
KA
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, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Copyright (C) Ashok Raj <ashok.raj@intel.com>
18 * Copyright (C) Shaohua Li <shaohua.li@intel.com>
19 */
20
21#ifndef __DMAR_H__
22#define __DMAR_H__
23
24#include <linux/acpi.h>
25#include <linux/types.h>
ba395927 26#include <linux/msi.h>
10e5247f 27
ba395927
KA
28#ifdef CONFIG_DMAR
29struct intel_iommu;
30
d94afc6c 31extern const char *dmar_get_fault_reason(u8 fault_reason);
3460a6d9
KA
32
33/* Can't use the common MSI interrupt functions
34 * since DMAR is not a pci device
35 */
36extern void dmar_msi_unmask(unsigned int irq);
37extern void dmar_msi_mask(unsigned int irq);
38extern void dmar_msi_read(int irq, struct msi_msg *msg);
39extern void dmar_msi_write(int irq, struct msi_msg *msg);
40extern int dmar_set_interrupt(struct intel_iommu *iommu);
41extern int arch_setup_dmar_msi(unsigned int irq);
42
ba395927
KA
43/* Intel IOMMU detection and initialization functions */
44extern void detect_intel_iommu(void);
45extern int intel_iommu_init(void);
10e5247f
KA
46
47extern int dmar_table_init(void);
48extern int early_dmar_detect(void);
1886e8a9 49extern int dmar_dev_scope_init(void);
ad3ad3f6 50extern int parse_ioapics_under_ir(void);
10e5247f
KA
51
52extern struct list_head dmar_drhd_units;
53extern struct list_head dmar_rmrr_units;
54
55struct dmar_drhd_unit {
56 struct list_head list; /* list of drhd units */
1886e8a9 57 struct acpi_dmar_header *hdr; /* ACPI header */
10e5247f
KA
58 u64 reg_base_addr; /* register base address*/
59 struct pci_dev **devices; /* target device array */
60 int devices_cnt; /* target device count */
61 u8 ignored:1; /* ignore drhd */
62 u8 include_all:1;
63 struct intel_iommu *iommu;
64};
65
66struct dmar_rmrr_unit {
67 struct list_head list; /* list of rmrr units */
1886e8a9 68 struct acpi_dmar_header *hdr; /* ACPI header */
10e5247f
KA
69 u64 base_address; /* reserved base address*/
70 u64 end_address; /* reserved end address */
71 struct pci_dev **devices; /* target devices */
72 int devices_cnt; /* target device count */
73};
74
ba395927
KA
75#define for_each_drhd_unit(drhd) \
76 list_for_each_entry(drhd, &dmar_drhd_units, list)
77#define for_each_rmrr_units(rmrr) \
78 list_for_each_entry(rmrr, &dmar_rmrr_units, list)
1886e8a9
SS
79
80extern int alloc_iommu(struct dmar_drhd_unit *);
ba395927
KA
81#else
82static inline void detect_intel_iommu(void)
83{
84 return;
85}
86static inline int intel_iommu_init(void)
87{
88 return -ENODEV;
89}
1886e8a9
SS
90static inline int dmar_table_init(void)
91{
92 return -ENODEV;
93}
ba395927 94#endif /* !CONFIG_DMAR */
10e5247f 95#endif /* __DMAR_H__ */
This page took 0.129442 seconds and 5 git commands to generate.