/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_POWERPC_CACHE_H #define _ASM_POWERPC_CACHE_H #ifdef __KERNEL__ /* bytes per L1 cache line */ #if defined(CONFIG_PPC_8xx) || defined(CONFIG_403GCX) #define L1_CACHE_SHIFT 4 #define MAX_COPY_PREFETCH 1 #elif defined(CONFIG_PPC_E500MC) #define L1_CACHE_SHIFT 6 #define MAX_COPY_PREFETCH 4 #elif defined(CONFIG_PPC32) #define MAX_COPY_PREFETCH 4 #if defined(CONFIG_PPC_47x) #define L1_CACHE_SHIFT 7 #else #define L1_CACHE_SHIFT 5 #endif #else /* CONFIG_PPC64 */ #define L1_CACHE_SHIFT 7 #define IFETCH_ALIGN_SHIFT 4 /* POWER8,9 */ #endif #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) #define SMP_CACHE_BYTES L1_CACHE_BYTES #define IFETCH_ALIGN_BYTES (1 << IFETCH_ALIGN_SHIFT) #if defined(__powerpc64__) && !defined(__ASSEMBLY__) struct ppc_cache_info { u32 size; u32 line_size; u32 block_size; /* L1 only */ u32 log_block_size; u32 blocks_per_page; u32 sets; u32 assoc; }; struct ppc64_caches { struct ppc_cache_info l1d; struct ppc_cache_info l1i; struct ppc_cache_info l2; struct ppc_cache_info l3; }; extern struct ppc64_caches ppc64_caches; #endif /* __powerpc64__ && ! __ASSEMBLY__ */ #if defined(__ASSEMBLY__) /* * For a snooping icache, we still need a dummy icbi to purge all the * prefetched instructions from the ifetch buffers. We also need a sync * before the icbi to order the the actual stores to memory that might * have modified instructions with the icbi. */ #define PURGE_PREFETCHED_INS \ sync; \ icbi 0,r3; \ sync; \ isync #else #define __read_mostly __attribute__((__section__(".data..read_mostly"))) #ifdef CONFIG_6xx extern long _get_L2CR(void); extern long _get_L3CR(void); extern void _set_L2CR(unsigned long); extern void _set_L3CR(unsigned long); #else #define _get_L2CR() 0L #define _get_L3CR() 0L #define _set_L2CR(val) do { } while(0) #define _set_L3CR(val) do { } while(0) #endif
static inline void dcbz(void *addr) { __asm__ __volatile__ ("dcbz 0, %0" : : "r"(addr) : "memory"); }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christophe Leroy | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Christophe Leroy | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Christophe Leroy | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Christophe Leroy | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 62 | 20.00% | 1 | 5.00% |
Christophe Leroy | 57 | 18.39% | 2 | 10.00% |
David Gibson | 55 | 17.74% | 1 | 5.00% |
Benjamin Herrenschmidt | 35 | 11.29% | 5 | 25.00% |
Stephen Rothwell | 21 | 6.77% | 1 | 5.00% |
Anton Blanchard | 19 | 6.13% | 3 | 15.00% |
Dave Kleikamp | 17 | 5.48% | 1 | 5.00% |
Kumar Gala | 14 | 4.52% | 1 | 5.00% |
Tony Breeds | 11 | 3.55% | 1 | 5.00% |
Nicholas Piggin | 9 | 2.90% | 1 | 5.00% |
Kevin Hao | 8 | 2.58% | 1 | 5.00% |
Greg Kroah-Hartman | 1 | 0.32% | 1 | 5.00% |
Denys Vlasenko | 1 | 0.32% | 1 | 5.00% |
Total | 310 | 100.00% | 20 | 100.00% |