diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-12-12 14:33:06 +0300 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-01-03 16:11:58 +0300 |
commit | a9dddbe0497ab0df7ee729e8d4cb0ee2dec3e4ba (patch) | |
tree | c86bed8b228e49808948fc7d42dd528b8086b4ef /arch/x86 | |
parent | 2e117604a4e8f3f9cee4aec3373b0382159e152a (diff) | |
download | linux-a9dddbe0497ab0df7ee729e8d4cb0ee2dec3e4ba.tar.xz |
AMD IOMMU: add necessary header defines for stats counting
Impact: add defines to make iommu stats collection configurable
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/amd_iommu_types.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h index 7abf9cf0c1fe..1379c5fe86d0 100644 --- a/arch/x86/include/asm/amd_iommu_types.h +++ b/arch/x86/include/asm/amd_iommu_types.h @@ -396,4 +396,30 @@ static inline u16 calc_devid(u8 bus, u8 devfn) return (((u16)bus) << 8) | devfn; } +#ifdef CONFIG_AMD_IOMMU_STATS + +struct __iommu_counter { + char *name; + struct dentry *dent; + u64 value; +}; + +#define DECLARE_STATS_COUNTER(nm) \ + static struct __iommu_counter nm = { \ + .name = #nm, \ + } + +#define INC_STATS_COUNTER(name) name.value += 1 +#define ADD_STATS_COUNTER(name, x) name.value += (x) +#define SUB_STATS_COUNTER(name, x) name.value -= (x) + +#else /* CONFIG_AMD_IOMMU_STATS */ + +#define DECLARE_STATS_COUNTER(name) +#define INC_STATS_COUNTER(name) +#define ADD_STATS_COUNTER(name, x) +#define SUB_STATS_COUNTER(name, x) + +#endif /* CONFIG_AMD_IOMMU_STATS */ + #endif /* _ASM_X86_AMD_IOMMU_TYPES_H */ |