Skip to content

Commit 217e604

Browse files
committed
logging: simplify is_rodata() for NIOS2, RISC-V and SPARC
NIOS2, RISC-V and SPARC are using _image_rodata_start/_end in their linker scripts to mark the boundaries of rodata. So they no loner need special treatment. Signed-off-by: Daniel Leung <[email protected]>
1 parent 30a56e2 commit 217e604

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

subsys/logging/log_core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,13 @@ uint32_t z_log_get_s_mask(const char *str, uint32_t nargs)
152152
*/
153153
static bool is_rodata(const void *addr)
154154
{
155-
#if defined(CONFIG_ARM) || defined(CONFIG_ARC) || defined(CONFIG_X86) || defined(CONFIG_ARM64)
155+
#if defined(CONFIG_ARM) || defined(CONFIG_ARC) || defined(CONFIG_X86) || \
156+
defined(CONFIG_ARM64) || defined(CONFIG_NIOS2) || \
157+
defined(CONFIG_RISCV) || defined(CONFIG_SPARC)
156158
extern const char *_image_rodata_start[];
157159
extern const char *_image_rodata_end[];
158160
#define RO_START _image_rodata_start
159161
#define RO_END _image_rodata_end
160-
#elif defined(CONFIG_NIOS2) || defined(CONFIG_RISCV) || defined(CONFIG_SPARC)
161-
extern const char *_image_rom_start[];
162-
extern const char *_image_rom_end[];
163-
#define RO_START _image_rom_start
164-
#define RO_END _image_rom_end
165162
#elif defined(CONFIG_XTENSA)
166163
extern const char *_rodata_start[];
167164
extern const char *_rodata_end[];

0 commit comments

Comments
 (0)