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>
This commit is contained in:
Christoph Winklhofer 2025-04-18 08:40:35 +02:00 committed by Benjamin Cabé
parent 8c7aded4c1
commit 501f33edea
4 changed files with 8 additions and 12 deletions

View File

@ -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,
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

View File

@ -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)
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);
}
/*

View File

@ -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)
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 */

View File

@ -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)
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);
}
/*