diff options
Diffstat (limited to 'firmware/target/mips/mmu-mips.h')
-rw-r--r-- | firmware/target/mips/mmu-mips.h | 17 |
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 | ||
35 | void map_address(unsigned long virtual, unsigned long physical, | 34 | void map_address(unsigned long virtual, unsigned long physical, |
36 | unsigned long length, unsigned int cache_flags); | 35 | unsigned long length, unsigned int cache_flags); |
37 | void mmu_init(void); | 36 | void mmu_init(void); |
38 | 37 | ||
39 | /* Commits entire DCache */ | 38 | /* Commits entire DCache */ |
40 | void commit_dcache(void) MIPS_CACHEFUNC_ATTR; | 39 | MIPS_CACHEFUNC_API(void, commit_dcache, (void)); |
41 | /* Commit and discard entire DCache, will do writeback */ | 40 | /* Commit and discard entire DCache, will do writeback */ |
42 | void commit_discard_dcache(void) MIPS_CACHEFUNC_ATTR; | 41 | MIPS_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 */ |
46 | void commit_discard_dcache_range(const void *base, unsigned int size) MIPS_CACHEFUNC_ATTR; | 45 | MIPS_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 */ |
49 | void commit_dcache_range(const void *base, unsigned int size) MIPS_CACHEFUNC_ATTR; | 48 | MIPS_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 | */ |
55 | void discard_dcache_range(const void *base, unsigned int size) MIPS_CACHEFUNC_ATTR; | 54 | MIPS_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 */ |
58 | void commit_discard_idcache(void) MIPS_CACHEFUNC_ATTR; | 57 | MIPS_CACHEFUNC_API(void, commit_discard_idcache, (void)); |
59 | 58 | ||
60 | #endif /* __MMU_MIPS_INCLUDE_H */ | 59 | #endif /* __MMU_MIPS_INCLUDE_H */ |