diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2011-04-11 11:03:18 +0200 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2011-04-12 09:21:51 +0200 |
commit | d99ddec3eee0be8a43b2c1ff624b9dfaaa26b959 (patch) | |
tree | a87ad31dc20c42346f05bf74f98aa84243bf50a4 /arch/x86/include/asm/amd_iommu_proto.h | |
parent | 7d0c5cc5be73f7ce26fdcca7b8ec2203f661eb93 (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.h | 10 |
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 1223c0fe03f5..a4ae6c3875eb 100644 --- a/arch/x86/include/asm/amd_iommu_proto.h +++ b/arch/x86/include/asm/amd_iommu_proto.h @@ -19,7 +19,7 @@ #ifndef _ASM_X86_AMD_IOMMU_PROTO_H #define _ASM_X86_AMD_IOMMU_PROTO_H -struct amd_iommu; +#include <asm/amd_iommu_types.h> extern int amd_iommu_init_dma_ops(void); extern int amd_iommu_init_passthrough(void); @@ -42,4 +42,12 @@ static inline bool is_rd890_iommu(struct pci_dev *pdev) (pdev->device == PCI_DEVICE_ID_RD890_IOMMU); } +static inline bool iommu_feature(struct amd_iommu *iommu, u64 f) +{ + if (!(iommu->cap & (1 << IOMMU_CAP_EFR))) + return false; + + return !!(iommu->features & f); +} + #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ |