]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
AMD IOMMU: add necessary header defines for stats counting
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 12 Dec 2008 11:33:06 +0000 (12:33 +0100)
committerJoerg Roedel <joerg.roedel@amd.com>
Sat, 3 Jan 2009 13:11:58 +0000 (14:11 +0100)
Impact: add defines to make iommu stats collection configurable

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/include/asm/amd_iommu_types.h

index 7abf9cf0c1fed7a1e1c478d99c9aec742e15fc3e..1379c5fe86d00d9fff91532fe3915aa606f85322 100644 (file)
@@ -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 */