From 34e11bf2bc2b8956de518b6c14a695c81fd81758 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 13 Jul 2022 23:19:14 +0200 Subject: [PATCH] sys/architecture: introduce uinttxtptr_t --- cpu/avr8_common/include/architecture_arch.h | 4 ++++ sys/include/architecture.h | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/cpu/avr8_common/include/architecture_arch.h b/cpu/avr8_common/include/architecture_arch.h index a4e7733fb5..9cca5f3362 100644 --- a/cpu/avr8_common/include/architecture_arch.h +++ b/cpu/avr8_common/include/architecture_arch.h @@ -29,6 +29,10 @@ extern "C" { /* Doc is provided centrally in platform.h, hide this from Doxygen */ #ifndef DOXYGEN #define ARCHITECTURE_WORD_BITS (8U) + +#define ARCHITECTURE_LARGE_TXT_PTR 1 +typedef uint32_t uinttxtptr_t; +#define PRIxTXTPTR PRIx32 #endif /* DOXYGEN */ #ifdef __cplusplus diff --git a/sys/include/architecture.h b/sys/include/architecture.h index 906b192eff..ebd7ce1c31 100644 --- a/sys/include/architecture.h +++ b/sys/include/architecture.h @@ -25,6 +25,7 @@ #define ARCHITECTURE_H #include +#include #include "architecture_arch.h" @@ -79,6 +80,18 @@ typedef int32_t sword_t; #error "Unsupported word size (check ARCHITECTURE_WORD_BITS in architecture_arch.h)" #endif +#if !defined(ARCHITECTURE_LARGE_TXT_PTR) || DOXYGEN +/** + * @brief Pointer type to point anywhere in the .text section + */ +typedef uintptr_t uinttxtptr_t; + +/** + * @brief Format string macro for text section pointer + */ +#define PRIxTXTPTR PRIxPTR +#endif + /** * @brief Type qualifier to use to align data on word boundaries *