Browse Source

arch: Unify declaration of text region

The declaration for the text region '__text_region_start' and
'__text_region_end' should be consistent with the declaration in the
include file 'zephyr/linker/linker-defs.h'.

The local declarations are:
  extern uintptr_t __text_region_start, __text_region_end;
whereas 'linker_defs.h' declares them as:
  extern char __text_region_start[];
  extern char __text_region_end[];

This may result in conflicting types when 'linker_defs.h' is indirectly
included. Hence, remove the local declarations.

Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
pull/88932/head
Christoph Winklhofer 3 months ago committed by Benjamin Cabé
parent
commit
501f33edea
  1. 5
      arch/riscv/core/stacktrace.c
  2. 5
      subsys/profiling/perf/backends/perf_riscv.c
  3. 5
      subsys/profiling/perf/backends/perf_x86.c
  4. 5
      subsys/profiling/perf/backends/perf_x86_64.c

5
arch/riscv/core/stacktrace.c

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
#include <zephyr/debug/symtab.h>
#include <zephyr/kernel.h>
#include <zephyr/kernel_structs.h>
#include <zephyr/linker/linker-defs.h>
#include <kernel_internal.h>
#include <zephyr/logging/log.h>
@ -90,9 +91,7 @@ static bool in_stack_bound(uintptr_t addr, const struct k_thread *const thread, @@ -90,9 +91,7 @@ static bool in_stack_bound(uintptr_t addr, const struct k_thread *const thread,
static inline bool in_text_region(uintptr_t addr)
{
extern uintptr_t __text_region_start, __text_region_end;
return (addr >= (uintptr_t)&__text_region_start) && (addr < (uintptr_t)&__text_region_end);
return (addr >= (uintptr_t)__text_region_start) && (addr < (uintptr_t)__text_region_end);
}
#ifdef CONFIG_FRAME_POINTER

5
subsys/profiling/perf/backends/perf_riscv.c

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
*/
#include <zephyr/kernel.h>
#include <zephyr/linker/linker-defs.h>
static bool valid_stack(uintptr_t addr, k_tid_t current)
{
@ -14,9 +15,7 @@ static bool valid_stack(uintptr_t addr, k_tid_t current) @@ -14,9 +15,7 @@ static bool valid_stack(uintptr_t addr, k_tid_t current)
static inline bool in_text_region(uintptr_t addr)
{
extern uintptr_t __text_region_start, __text_region_end;
return (addr >= (uintptr_t)&__text_region_start) && (addr < (uintptr_t)&__text_region_end);
return (addr >= (uintptr_t)__text_region_start) && (addr < (uintptr_t)__text_region_end);
}
/*

5
subsys/profiling/perf/backends/perf_x86.c

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
*/
#include <zephyr/kernel.h>
#include <zephyr/linker/linker-defs.h>
static bool valid_stack(uintptr_t addr, k_tid_t current)
{
@ -15,9 +16,7 @@ static bool valid_stack(uintptr_t addr, k_tid_t current) @@ -15,9 +16,7 @@ static bool valid_stack(uintptr_t addr, k_tid_t current)
static inline bool in_text_region(uintptr_t addr)
{
extern uintptr_t __text_region_start, __text_region_end;
return (addr >= (uintptr_t)&__text_region_start) && (addr < (uintptr_t)&__text_region_end);
return (addr >= (uintptr_t)__text_region_start) && (addr < (uintptr_t)__text_region_end);
}
/* interruption stack frame */

5
subsys/profiling/perf/backends/perf_x86_64.c

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
*/
#include <zephyr/kernel.h>
#include <zephyr/linker/linker-defs.h>
static bool valid_stack(uintptr_t addr, k_tid_t current)
{
@ -15,9 +16,7 @@ static bool valid_stack(uintptr_t addr, k_tid_t current) @@ -15,9 +16,7 @@ static bool valid_stack(uintptr_t addr, k_tid_t current)
static inline bool in_text_region(uintptr_t addr)
{
extern uintptr_t __text_region_start, __text_region_end;
return (addr >= (uintptr_t)&__text_region_start) && (addr < (uintptr_t)&__text_region_end);
return (addr >= (uintptr_t)__text_region_start) && (addr < (uintptr_t)__text_region_end);
}
/*

Loading…
Cancel
Save