diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2017-07-13 15:10:04 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-07-22 22:22:51 -0400 |
commit | 506cb8be7e83d29b316e1708bcf05359be16cfb7 (patch) | |
tree | 1c060929e670797c4adde5586c6ef0eac155c939 /arch/powerpc/include/asm/cache.h | |
parent | 7fd697fd54eabd3cfe28414d9c05f65c8cfd9585 (diff) |
powerpc, 8xx: move cache helper into C
Avoid unnecessary assembly functions when they can easily be written
in C.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Diffstat (limited to 'arch/powerpc/include/asm/cache.h')
-rw-r--r-- | arch/powerpc/include/asm/cache.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h index d3a83910b6..0801d2c367 100644 --- a/arch/powerpc/include/asm/cache.h +++ b/arch/powerpc/include/asm/cache.h @@ -107,6 +107,38 @@ void disable_cpc_sram(void); #define DC_DFWT 0x40000000 /* Data cache is forced write through */ #define DC_LES 0x20000000 /* Caches are little endian mode */ + +#if !defined(__ASSEMBLY__) +static inline uint rd_ic_cst(void) +{ + return mfspr(IC_CST); +} + +static inline void wr_ic_cst(uint val) +{ + mtspr(IC_CST, val); +} + +static inline void wr_ic_adr(uint val) +{ + mtspr(IC_ADR, val); +} + +static inline uint rd_dc_cst(void) +{ + return mfspr(DC_CST); +} + +static inline void wr_dc_cst(uint val) +{ + mtspr(DC_CST, val); +} + +static inline void wr_dc_adr(uint val) +{ + mtspr(DC_ADR, val); +} +#endif #endif /* CONFIG_8xx */ #endif |