aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2008-11-20 10:49:44 -0500
committerJoerg Roedel <joerg.roedel@amd.com>2009-01-03 05:57:35 -0500
commit46b08e1a76b758193b0e7b889c6486a16eb1e9e2 (patch)
tree0a71af4a4bef41e512adabdd0d343c1aa1c8e103 /include/linux
parentf27be03b271851fd54529f292c0f25b4c1f1a553 (diff)
intel-iommu: move root entry defs from dma_remapping.h
We keep the struct root_entry forward declaration for the pointer in struct intel_iommu. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dma_remapping.h34
1 files changed, 1 insertions, 33 deletions
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 2e5a5c0b6acd..d8521662a495 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -9,39 +9,7 @@
9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) 9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) 10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
11 11
12/* 12struct root_entry;
13 * 0: Present
14 * 1-11: Reserved
15 * 12-63: Context Ptr (12 - (haw-1))
16 * 64-127: Reserved
17 */
18struct root_entry {
19 u64 val;
20 u64 rsvd1;
21};
22#define ROOT_ENTRY_NR (VTD_PAGE_SIZE/sizeof(struct root_entry))
23static inline bool root_present(struct root_entry *root)
24{
25 return (root->val & 1);
26}
27static inline void set_root_present(struct root_entry *root)
28{
29 root->val |= 1;
30}
31static inline void set_root_value(struct root_entry *root, unsigned long value)
32{
33 root->val |= value & VTD_PAGE_MASK;
34}
35
36struct context_entry;
37static inline struct context_entry *
38get_context_addr_from_root(struct root_entry *root)
39{
40 return (struct context_entry *)
41 (root_present(root)?phys_to_virt(
42 root->val & VTD_PAGE_MASK) :
43 NULL);
44}
45 13
46/* 14/*
47 * low 64 bits: 15 * low 64 bits: