aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-12-12 06:33:06 -0500
committerJoerg Roedel <joerg.roedel@amd.com>2009-01-03 08:11:58 -0500
commita9dddbe0497ab0df7ee729e8d4cb0ee2dec3e4ba (patch)
treec86bed8b228e49808948fc7d42dd528b8086b4ef /arch/x86/include
parent2e117604a4e8f3f9cee4aec3373b0382159e152a (diff)
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/include')
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h26
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)
396 return (((u16)bus) << 8) | devfn; 396 return (((u16)bus) << 8) | devfn;
397} 397}
398 398
399#ifdef CONFIG_AMD_IOMMU_STATS
400
401struct __iommu_counter {
402 char *name;
403 struct dentry *dent;
404 u64 value;
405};
406
407#define DECLARE_STATS_COUNTER(nm) \
408 static struct __iommu_counter nm = { \
409 .name = #nm, \
410 }
411
412#define INC_STATS_COUNTER(name) name.value += 1
413#define ADD_STATS_COUNTER(name, x) name.value += (x)
414#define SUB_STATS_COUNTER(name, x) name.value -= (x)
415
416#else /* CONFIG_AMD_IOMMU_STATS */
417
418#define DECLARE_STATS_COUNTER(name)
419#define INC_STATS_COUNTER(name)
420#define ADD_STATS_COUNTER(name, x)
421#define SUB_STATS_COUNTER(name, x)
422
423#endif /* CONFIG_AMD_IOMMU_STATS */
424
399#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */ 425#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */