27 #include "architecture_arch.h"
39 #ifndef ARCHITECTURE_BREAKPOINT
43 #define ARCHITECTURE_BREAKPOINT(value) do {} while (1)
53 #define ARCHITECTURE_WORD_BITS <NUM>
59 #define ARCHITECTURE_WORD_BYTES <ARCHITECTURE_WORD_BITS / 8>
80 #define SWORD_MAX <2^(ARCHITECTURE_WORD_BITS - 1) - 1>
84 #define SWORD_MIN <-2^(ARCHITECTURE_WORD_BITS - 1)>
88 #define UWORD_MAX <2^ARCHITECTURE_WORD_BITS - 1>
91 #elif (ARCHITECTURE_WORD_BITS == 8)
92 #define ARCHITECTURE_WORD_BYTES (1U)
95 #define SWORD_MAX (INT8_MAX)
96 #define SWORD_MIN (INT8_MIN)
97 #define UWORD_MAX (UINT8_MAX)
98 #elif (ARCHITECTURE_WORD_BITS == 16)
99 #define ARCHITECTURE_WORD_BYTES (2U)
102 #define SWORD_MAX (INT16_MAX)
103 #define SWORD_MIN (INT16_MIN)
104 #define UWORD_MAX (UINT16_MAX)
105 #elif (ARCHITECTURE_WORD_BITS == 32)
106 #define ARCHITECTURE_WORD_BYTES (4U)
109 #define SWORD_MAX (INT32_MAX)
110 #define SWORD_MIN (INT32_MIN)
111 #define UWORD_MAX (UINT32_MAX)
112 #elif (ARCHITECTURE_WORD_BITS == 64)
113 #define ARCHITECTURE_WORD_BYTES (8U)
116 #define SWORD_MAX (INT64_MAX)
117 #define SWORD_MIN (INT64_MIN)
118 #define UWORD_MAX (UINT64_MAX)
120 #error "Unsupported word size (check ARCHITECTURE_WORD_BITS in architecture_arch.h)"
126 #define UWORD_MIN (0U)
128 #if !defined(ARCHITECTURE_LARGE_TXT_PTR) || DOXYGEN
137 #define PRIxTXTPTR PRIxPTR
144 #define PRI_SIZE_T_MODIFIER
145 #elif (UINT_MAX == SIZE_MAX)
146 #define PRI_SIZE_T_MODIFIER ""
147 #elif (ULONG_MAX == SIZE_MAX)
148 #define PRI_SIZE_T_MODIFIER "l"
150 #error Unsupported size_t length
157 #define PRIdSIZE PRI_SIZE_T_MODIFIER "d"
165 #define PRIiSIZE PRI_SIZE_T_MODIFIER "i"
170 #define PRIoSIZE PRI_SIZE_T_MODIFIER "o"
175 #define PRIuSIZE PRI_SIZE_T_MODIFIER "u"
183 #define PRIxSIZE PRI_SIZE_T_MODIFIER "x"
191 #define PRIXSIZE PRI_SIZE_T_MODIFIER "X"
202 #define WORD_ALIGNED __attribute__((aligned(ARCHITECTURE_WORD_BYTES)))
214 #define HAS_ALIGNMENT_OF(addr, alignment) (((uintptr_t)(addr) & ((alignment) - 1)) == 0)
222 #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.