summaryrefslogtreecommitdiff
path: root/firmware/target/mips/mmu-mips.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/mmu-mips.h')
-rw-r--r--firmware/target/mips/mmu-mips.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/firmware/target/mips/mmu-mips.h b/firmware/target/mips/mmu-mips.h
index b54807f060..b8f5ff0143 100644
--- a/firmware/target/mips/mmu-mips.h
+++ b/firmware/target/mips/mmu-mips.h
@@ -28,33 +28,32 @@
28 * called safely eg. by the bootloader or RoLo, which need to flush the 28 * called safely eg. by the bootloader or RoLo, which need to flush the
29 * cache before jumping to the loaded binary. 29 * cache before jumping to the loaded binary.
30 */ 30 */
31#ifndef MIPS_CACHEFUNC_ATTR 31#define MIPS_CACHEFUNC_API(ret, name, args) \
32# define MIPS_CACHEFUNC_ATTR __attribute__((section(".icode"))) 32 ret name args __attribute__((section( ".icode." #name )))
33#endif
34 33
35void map_address(unsigned long virtual, unsigned long physical, 34void map_address(unsigned long virtual, unsigned long physical,
36 unsigned long length, unsigned int cache_flags); 35 unsigned long length, unsigned int cache_flags);
37void mmu_init(void); 36void mmu_init(void);
38 37
39/* Commits entire DCache */ 38/* Commits entire DCache */
40void commit_dcache(void) MIPS_CACHEFUNC_ATTR; 39MIPS_CACHEFUNC_API(void, commit_dcache, (void));
41/* Commit and discard entire DCache, will do writeback */ 40/* Commit and discard entire DCache, will do writeback */
42void commit_discard_dcache(void) MIPS_CACHEFUNC_ATTR; 41MIPS_CACHEFUNC_API(void, commit_discard_dcache, (void));
43 42
44/* Write DCache back to RAM for the given range and remove cache lines 43/* Write DCache back to RAM for the given range and remove cache lines
45 * from DCache afterwards */ 44 * from DCache afterwards */
46void commit_discard_dcache_range(const void *base, unsigned int size) MIPS_CACHEFUNC_ATTR; 45MIPS_CACHEFUNC_API(void, commit_discard_dcache_range, (const void *base, unsigned int size));
47 46
48/* Write DCache back to RAM for the given range */ 47/* Write DCache back to RAM for the given range */
49void commit_dcache_range(const void *base, unsigned int size) MIPS_CACHEFUNC_ATTR; 48MIPS_CACHEFUNC_API(void, commit_dcache_range, (const void *base, unsigned int size));
50 49
51/* 50/*
52 * Remove cache lines for the given range from DCache 51 * Remove cache lines for the given range from DCache
53 * will *NOT* do write back except for buffer edges not on a line boundary 52 * will *NOT* do write back except for buffer edges not on a line boundary
54 */ 53 */
55void discard_dcache_range(const void *base, unsigned int size) MIPS_CACHEFUNC_ATTR; 54MIPS_CACHEFUNC_API(void, discard_dcache_range, (const void *base, unsigned int size));
56 55
57/* Discards the entire ICache, and commit+discards the entire DCache */ 56/* Discards the entire ICache, and commit+discards the entire DCache */
58void commit_discard_idcache(void) MIPS_CACHEFUNC_ATTR; 57MIPS_CACHEFUNC_API(void, commit_discard_idcache, (void));
59 58
60#endif /* __MMU_MIPS_INCLUDE_H */ 59#endif /* __MMU_MIPS_INCLUDE_H */