summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/cacheinfo.h
diff options
context:
space:
mode:
authorYash Shah <yash.shah@sifive.com>2020-02-20 10:45:18 +0530
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-05-20 15:05:05 -0700
commit087958a17658dcd92cdc9292e6ce4319a25198fb (patch)
treec88139e8678336fcfa439c7ddf91d96bf05d45be /arch/riscv/include/asm/cacheinfo.h
parent0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 (diff)
riscv: cacheinfo: Implement cache_get_priv_group with a generic ops structure
Implement cache_get_priv_group() that will make use of a generic ops structure to return a private attribute group for custom cache info. Using riscv_set_cacheinfo_ops() users can hook their own custom function to return the private attribute group for cacheinfo. In future we can add more ops to this generic ops structure for SOC specific cacheinfo. Signed-off-by: Yash Shah <yash.shah@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/cacheinfo.h')
-rw-r--r--arch/riscv/include/asm/cacheinfo.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/cacheinfo.h b/arch/riscv/include/asm/cacheinfo.h
new file mode 100644
index 000000000000..5d9662e9aba8
--- /dev/null
+++ b/arch/riscv/include/asm/cacheinfo.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _ASM_RISCV_CACHEINFO_H
+#define _ASM_RISCV_CACHEINFO_H
+
+#include <linux/cacheinfo.h>
+
+struct riscv_cacheinfo_ops {
+ const struct attribute_group * (*get_priv_group)(struct cacheinfo
+ *this_leaf);
+};
+
+void riscv_set_cacheinfo_ops(struct riscv_cacheinfo_ops *ops);
+
+#endif /* _ASM_RISCV_CACHEINFO_H */