aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/amd_iommu_proto.h
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-04-11 05:03:18 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-04-12 03:21:51 -0400
commitd99ddec3eee0be8a43b2c1ff624b9dfaaa26b959 (patch)
treea87ad31dc20c42346f05bf74f98aa84243bf50a4 /arch/x86/include/asm/amd_iommu_proto.h
parent7d0c5cc5be73f7ce26fdcca7b8ec2203f661eb93 (diff)
x86/amd-iommu: Add extended feature detection
This patch adds detection of the extended features of an AMD IOMMU. The available features are printed to dmesg on boot. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/include/asm/amd_iommu_proto.h')
-rw-r--r--arch/x86/include/asm/amd_iommu_proto.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h
index 1223c0fe03f..a4ae6c3875e 100644
--- a/arch/x86/include/asm/amd_iommu_proto.h
+++ b/arch/x86/include/asm/amd_iommu_proto.h
@@ -19,7 +19,7 @@
19#ifndef _ASM_X86_AMD_IOMMU_PROTO_H 19#ifndef _ASM_X86_AMD_IOMMU_PROTO_H
20#define _ASM_X86_AMD_IOMMU_PROTO_H 20#define _ASM_X86_AMD_IOMMU_PROTO_H
21 21
22struct amd_iommu; 22#include <asm/amd_iommu_types.h>
23 23
24extern int amd_iommu_init_dma_ops(void); 24extern int amd_iommu_init_dma_ops(void);
25extern int amd_iommu_init_passthrough(void); 25extern int amd_iommu_init_passthrough(void);
@@ -42,4 +42,12 @@ static inline bool is_rd890_iommu(struct pci_dev *pdev)
42 (pdev->device == PCI_DEVICE_ID_RD890_IOMMU); 42 (pdev->device == PCI_DEVICE_ID_RD890_IOMMU);
43} 43}
44 44
45static inline bool iommu_feature(struct amd_iommu *iommu, u64 f)
46{
47 if (!(iommu->cap & (1 << IOMMU_CAP_EFR)))
48 return false;
49
50 return !!(iommu->features & f);
51}
52
45#endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ 53#endif /* _ASM_X86_AMD_IOMMU_PROTO_H */