diff options
author | Robin Murphy <[email protected]> | 2017-07-25 11:55:42 +0100 |
---|---|---|
committer | Catalin Marinas <[email protected]> | 2017-08-09 12:15:45 +0100 |
commit | d50e071fdaa33c1b399c764c44fa1ce879881185 (patch) | |
tree | c0af7e49c8f4124195159e1d6380d521bea435d3 /arch/arm64/mm/flush.c | |
parent | e1bc5d1b8e0547c258e65dd97a03560f4d69e635 (diff) |
arm64: Implement pmem API support
Add a clean-to-point-of-persistence cache maintenance helper, and wire
up the basic architectural support for the pmem driver based on it.
Reviewed-by: Will Deacon <[email protected]>
Signed-off-by: Robin Murphy <[email protected]>
[[email protected]: move arch_*_pmem() functions to arch/arm64/mm/flush.c]
[[email protected]: change dmb(sy) to dmb(osh)]
Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'arch/arm64/mm/flush.c')
-rw-r--r-- | arch/arm64/mm/flush.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index 21a8d828cbf4..280f90ff33a2 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -83,3 +83,19 @@ EXPORT_SYMBOL(flush_dcache_page); * Additional functions defined in assembly. */ EXPORT_SYMBOL(flush_icache_range); + +#ifdef CONFIG_ARCH_HAS_PMEM_API +static inline void arch_wb_cache_pmem(void *addr, size_t size) +{ + /* Ensure order against any prior non-cacheable writes */ + dmb(osh); + __clean_dcache_area_pop(addr, size); +} +EXPORT_SYMBOL_GPL(arch_wb_cache_pmem); + +static inline void arch_invalidate_pmem(void *addr, size_t size) +{ + __inval_dcache_area(addr, size); +} +EXPORT_SYMBOL_GPL(arch_invalidate_pmem); +#endif |