Skip to content

Commit e027a54

Browse files
lyakhnashif
authored andcommitted
cavs: remove unused and dangerous definitions
uncache_to_cache(), cache_to_uncache() and is_uncached() macros are currently unused in Zephyr, besides the former two are dangerous because they add and subtract an offset instead of masking and unmasking a bit, which can lead to wrong addresses if applied repeatedly. Remove these macros for now, we can re-add them later if needed in their fixed versions. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent d7a3752 commit e027a54

File tree

4 files changed

+0
-32
lines changed

4 files changed

+0
-32
lines changed

soc/xtensa/intel_adsp/cavs_v15/include/soc/memory.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,6 @@
140140
#define SRAM_ALIAS_MASK 0xFF000000
141141
#define SRAM_ALIAS_OFFSET 0x20000000
142142

143-
144-
#define uncache_to_cache(address) \
145-
((__typeof__(address))((uint32_t)(address) + SRAM_ALIAS_OFFSET))
146-
#define cache_to_uncache(address) \
147-
((__typeof__(address))((uint32_t)(address) - SRAM_ALIAS_OFFSET))
148-
#define is_uncached(address) \
149-
(((uint32_t)(address) & SRAM_ALIAS_MASK) == SRAM_ALIAS_BASE)
150-
151143
/* shim */
152144
#define SHIM_BASE 0x00001000
153145
#define SHIM_SIZE 0x00000100

soc/xtensa/intel_adsp/cavs_v18/include/soc/memory.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,6 @@
137137
#define SRAM_ALIAS_MASK 0xFF000000
138138
#define SRAM_ALIAS_OFFSET 0x20000000
139139

140-
141-
#define uncache_to_cache(address) \
142-
((__typeof__(address))((uint32_t)(address) + SRAM_ALIAS_OFFSET))
143-
#define cache_to_uncache(address) \
144-
((__typeof__(address))((uint32_t)(address) - SRAM_ALIAS_OFFSET))
145-
#define is_uncached(address) \
146-
(((uint32_t)(address) & SRAM_ALIAS_MASK) == SRAM_ALIAS_BASE)
147-
148140
/* shim */
149141
#define SHIM_BASE 0x00071F00
150142
#define SHIM_SIZE 0x00000100

soc/xtensa/intel_adsp/cavs_v20/include/soc/memory.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,6 @@
137137
#define SRAM_ALIAS_MASK 0xFF000000
138138
#define SRAM_ALIAS_OFFSET 0x20000000
139139

140-
141-
#define uncache_to_cache(address) \
142-
((__typeof__(address))((uint32_t)(address) + SRAM_ALIAS_OFFSET))
143-
#define cache_to_uncache(address) \
144-
((__typeof__(address))((uint32_t)(address) - SRAM_ALIAS_OFFSET))
145-
#define is_uncached(address) \
146-
(((uint32_t)(address) & SRAM_ALIAS_MASK) == SRAM_ALIAS_BASE)
147-
148140
/* shim */
149141
#define SHIM_BASE 0x00071F00
150142
#define SHIM_SIZE 0x00000100

soc/xtensa/intel_adsp/cavs_v25/include/soc/memory.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@
139139
#define SRAM_ALIAS_MASK 0xFF000000
140140
#define SRAM_ALIAS_OFFSET 0x20000000
141141

142-
143-
#define uncache_to_cache(address) \
144-
((__typeof__(address))((uint32_t)(address) + SRAM_ALIAS_OFFSET))
145-
#define cache_to_uncache(address) \
146-
((__typeof__(address))((uint32_t)(address) - SRAM_ALIAS_OFFSET))
147-
#define is_uncached(address) \
148-
(((uint32_t)(address) & SRAM_ALIAS_MASK) == SRAM_ALIAS_BASE)
149-
150142
/* shim */
151143
#define SHIM_BASE 0x00071F00
152144
#define SHIM_SIZE 0x00000100

0 commit comments

Comments
 (0)