memory: add cache_to_uncache and uncache_to_cache macros

Adds macros, which allows to retrieve cached/uncached version
of memory pointer.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2018-08-14 14:45:40 +02:00
parent 2530814a0a
commit 56f52b96a3
4 changed files with 18 additions and 0 deletions

View File

@ -359,4 +359,10 @@
/** \brief Manifest size (seems unused). */ /** \brief Manifest size (seems unused). */
#define IMR_BOOT_LDR_MANIFEST_SIZE 0x6000 #define IMR_BOOT_LDR_MANIFEST_SIZE 0x6000
#define SRAM_ALIAS_OFFSET 0x20000000
#define uncache_to_cache(address) \
((__typeof__((address)))((uint32_t)((address)) + SRAM_ALIAS_OFFSET))
#define cache_to_uncache(address) \
((__typeof__((address)))((uint32_t)((address)) - SRAM_ALIAS_OFFSET))
#endif #endif

View File

@ -148,4 +148,7 @@
#define SOF_MEM_RO_SIZE 0x8 #define SOF_MEM_RO_SIZE 0x8
#define uncache_to_cache(address) address
#define cache_to_uncache(address) address
#endif #endif

View File

@ -357,4 +357,10 @@
#define IMR_BOOT_LDR_BSS_BASE 0xB0100000 #define IMR_BOOT_LDR_BSS_BASE 0xB0100000
#define IMR_BOOT_LDR_BSS_SIZE 0x10000 #define IMR_BOOT_LDR_BSS_SIZE 0x10000
#define SRAM_ALIAS_OFFSET 0x20000000
#define uncache_to_cache(address) \
((__typeof__((address)))((uint32_t)((address)) + SRAM_ALIAS_OFFSET))
#define cache_to_uncache(address) \
((__typeof__((address)))((uint32_t)((address)) - SRAM_ALIAS_OFFSET))
#endif #endif

View File

@ -145,4 +145,7 @@
#define SOF_MEM_RO_SIZE 0x8 #define SOF_MEM_RO_SIZE 0x8
#define uncache_to_cache(address) address
#define cache_to_uncache(address) address
#endif #endif