aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/cache.h
diff options
context:
space:
mode:
authorAlastair D'Silva <alastair@d-silva.org>2019-11-04 13:32:55 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2019-11-07 22:48:34 +1100
commit7a0745c5e03ff1129864bc6d80f5c4417e8d7893 (patch)
tree9c55e9ade85db37bf758208d8a4c6cd5393c12d6 /arch/powerpc/include/asm/cache.h
parentpowerpc: Allow 64bit VDSO __kernel_sync_dicache to work across ranges >4GB (diff)
downloadlinux-dev-7a0745c5e03ff1129864bc6d80f5c4417e8d7893.tar.xz
linux-dev-7a0745c5e03ff1129864bc6d80f5c4417e8d7893.zip
powerpc: define helpers to get L1 icache sizes
This patch adds helpers to retrieve icache sizes, and renames the existing helpers to make it clear that they are for dcache. Signed-off-by: Alastair D'Silva <alastair@d-silva.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20191104023305.9581-4-alastair@au1.ibm.com
Diffstat (limited to 'arch/powerpc/include/asm/cache.h')
-rw-r--r--arch/powerpc/include/asm/cache.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 45e3137ccd71..afb88754e0e0 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -55,25 +55,46 @@ struct ppc64_caches {
extern struct ppc64_caches ppc64_caches;
-static inline u32 l1_cache_shift(void)
+static inline u32 l1_dcache_shift(void)
{
return ppc64_caches.l1d.log_block_size;
}
-static inline u32 l1_cache_bytes(void)
+static inline u32 l1_dcache_bytes(void)
{
return ppc64_caches.l1d.block_size;
}
+
+static inline u32 l1_icache_shift(void)
+{
+ return ppc64_caches.l1i.log_block_size;
+}
+
+static inline u32 l1_icache_bytes(void)
+{
+ return ppc64_caches.l1i.block_size;
+}
#else
-static inline u32 l1_cache_shift(void)
+static inline u32 l1_dcache_shift(void)
{
return L1_CACHE_SHIFT;
}
-static inline u32 l1_cache_bytes(void)
+static inline u32 l1_dcache_bytes(void)
{
return L1_CACHE_BYTES;
}
+
+static inline u32 l1_icache_shift(void)
+{
+ return L1_CACHE_SHIFT;
+}
+
+static inline u32 l1_icache_bytes(void)
+{
+ return L1_CACHE_BYTES;
+}
+
#endif
#endif /* ! __ASSEMBLY__ */