mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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
This commit is contained in:
parent
f9ec111653
commit
7a0745c5e0
2 changed files with 31 additions and 10 deletions
|
@ -63,8 +63,8 @@ static inline void __flush_dcache_icache_phys(unsigned long physaddr)
|
|||
*/
|
||||
static inline void flush_dcache_range(unsigned long start, unsigned long stop)
|
||||
{
|
||||
unsigned long shift = l1_cache_shift();
|
||||
unsigned long bytes = l1_cache_bytes();
|
||||
unsigned long shift = l1_dcache_shift();
|
||||
unsigned long bytes = l1_dcache_bytes();
|
||||
void *addr = (void *)(start & ~(bytes - 1));
|
||||
unsigned long size = stop - (unsigned long)addr + (bytes - 1);
|
||||
unsigned long i;
|
||||
|
@ -89,8 +89,8 @@ static inline void flush_dcache_range(unsigned long start, unsigned long stop)
|
|||
*/
|
||||
static inline void clean_dcache_range(unsigned long start, unsigned long stop)
|
||||
{
|
||||
unsigned long shift = l1_cache_shift();
|
||||
unsigned long bytes = l1_cache_bytes();
|
||||
unsigned long shift = l1_dcache_shift();
|
||||
unsigned long bytes = l1_dcache_bytes();
|
||||
void *addr = (void *)(start & ~(bytes - 1));
|
||||
unsigned long size = stop - (unsigned long)addr + (bytes - 1);
|
||||
unsigned long i;
|
||||
|
@ -108,8 +108,8 @@ static inline void clean_dcache_range(unsigned long start, unsigned long stop)
|
|||
static inline void invalidate_dcache_range(unsigned long start,
|
||||
unsigned long stop)
|
||||
{
|
||||
unsigned long shift = l1_cache_shift();
|
||||
unsigned long bytes = l1_cache_bytes();
|
||||
unsigned long shift = l1_dcache_shift();
|
||||
unsigned long bytes = l1_dcache_bytes();
|
||||
void *addr = (void *)(start & ~(bytes - 1));
|
||||
unsigned long size = stop - (unsigned long)addr + (bytes - 1);
|
||||
unsigned long i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue