blob: 7d683dc8ed1e2ae796d59a39891fbaea1afd241c [file] [log] [blame]
Keshavamurthy, Anil S10e52472007-10-21 16:41:41 -07001/*
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>
Keshavamurthy, Anil Sba395922007-10-21 16:41:49 -070026#include <linux/msi.h>
Keshavamurthy, Anil S10e52472007-10-21 16:41:41 -070027
Keshavamurthy, Anil Sba395922007-10-21 16:41:49 -070028#ifdef CONFIG_DMAR
29struct intel_iommu;
30
31/* Intel IOMMU detection and initialization functions */
32extern void detect_intel_iommu(void);
33extern int intel_iommu_init(void);
Keshavamurthy, Anil S10e52472007-10-21 16:41:41 -070034
35extern int dmar_table_init(void);
36extern int early_dmar_detect(void);
37
38extern struct list_head dmar_drhd_units;
39extern struct list_head dmar_rmrr_units;
40
41struct dmar_drhd_unit {
42 struct list_head list; /* list of drhd units */
43 u64 reg_base_addr; /* register base address*/
44 struct pci_dev **devices; /* target device array */
45 int devices_cnt; /* target device count */
46 u8 ignored:1; /* ignore drhd */
47 u8 include_all:1;
48 struct intel_iommu *iommu;
49};
50
51struct dmar_rmrr_unit {
52 struct list_head list; /* list of rmrr units */
53 u64 base_address; /* reserved base address*/
54 u64 end_address; /* reserved end address */
55 struct pci_dev **devices; /* target devices */
56 int devices_cnt; /* target device count */
57};
58
Keshavamurthy, Anil Sba395922007-10-21 16:41:49 -070059#define for_each_drhd_unit(drhd) \
60 list_for_each_entry(drhd, &dmar_drhd_units, list)
61#define for_each_rmrr_units(rmrr) \
62 list_for_each_entry(rmrr, &dmar_rmrr_units, list)
63#else
64static inline void detect_intel_iommu(void)
65{
66 return;
67}
68static inline int intel_iommu_init(void)
69{
70 return -ENODEV;
71}
72
73#endif /* !CONFIG_DMAR */
Keshavamurthy, Anil S10e52472007-10-21 16:41:41 -070074#endif /* __DMAR_H__ */