31#include "architecture_arch.h"
43#ifndef ARCHITECTURE_BREAKPOINT
47#define ARCHITECTURE_BREAKPOINT(value) do {} while (1)
57#define ARCHITECTURE_WORD_BITS <NUM>
63#define ARCHITECTURE_WORD_BYTES <ARCHITECTURE_WORD_BITS / 8>
84#define SWORD_MAX <2^(ARCHITECTURE_WORD_BITS - 1) - 1>
88#define SWORD_MIN <-2^(ARCHITECTURE_WORD_BITS - 1)>
92#define UWORD_MAX <2^ARCHITECTURE_WORD_BITS - 1>
95#elif (ARCHITECTURE_WORD_BITS == 8)
96#define ARCHITECTURE_WORD_BYTES (1U)
99#define SWORD_MAX (INT8_MAX)
100#define SWORD_MIN (INT8_MIN)
101#define UWORD_MAX (UINT8_MAX)
102#elif (ARCHITECTURE_WORD_BITS == 16)
103#define ARCHITECTURE_WORD_BYTES (2U)
106#define SWORD_MAX (INT16_MAX)
107#define SWORD_MIN (INT16_MIN)
108#define UWORD_MAX (UINT16_MAX)
109#elif (ARCHITECTURE_WORD_BITS == 32)
110#define ARCHITECTURE_WORD_BYTES (4U)
113#define SWORD_MAX (INT32_MAX)
114#define SWORD_MIN (INT32_MIN)
115#define UWORD_MAX (UINT32_MAX)
116#elif (ARCHITECTURE_WORD_BITS == 64)
117#define ARCHITECTURE_WORD_BYTES (8U)
120#define SWORD_MAX (INT64_MAX)
121#define SWORD_MIN (INT64_MIN)
122#define UWORD_MAX (UINT64_MAX)
124#error "Unsupported word size (check ARCHITECTURE_WORD_BITS in architecture_arch.h)"
130#define UWORD_MIN (0U)
132#if !defined(ARCHITECTURE_LARGE_TXT_PTR) || DOXYGEN
141#define PRIxTXTPTR PRIxPTR
148#define PRI_SIZE_T_MODIFIER
149#elif (UINT_MAX == SIZE_MAX)
150#define PRI_SIZE_T_MODIFIER ""
151#elif (ULONG_MAX == SIZE_MAX)
152#define PRI_SIZE_T_MODIFIER "l"
154#error Unsupported size_t length
161#define PRIdSIZE PRI_SIZE_T_MODIFIER "d"
169#define PRIiSIZE PRI_SIZE_T_MODIFIER "i"
174#define PRIoSIZE PRI_SIZE_T_MODIFIER "o"
179#define PRIuSIZE PRI_SIZE_T_MODIFIER "u"
187#define PRIxSIZE PRI_SIZE_T_MODIFIER "x"
195#define PRIXSIZE PRI_SIZE_T_MODIFIER "X"
206#define WORD_ALIGNED __attribute__((aligned(ARCHITECTURE_WORD_BYTES)))
218#define HAS_ALIGNMENT_OF(addr, alignment) (((uintptr_t)(addr) & ((alignment) - 1)) == 0)
226#define IS_WORD_ALIGNED(addr) HAS_ALIGNMENT_OF(addr, ARCHITECTURE_WORD_BYTES)
uint< NUM > _t uword_t
Word sized unsigned integer.
int< NUM > _t sword_t
Word sized signed integer.
uintptr_t uinttxtptr_t
Pointer type to point anywhere in the .text section.
Adds include for missing inttype definitions.