4 #include <commonlib/helpers.h>
7 typedef long ptrdiff_t;
9 #define __SIZE_TYPE__ unsigned long
11 typedef __SIZE_TYPE__
size_t;
12 /* There is a GCC macro for a size_t type, but not
13 * for a ssize_t type. Below construct tricks GCC
14 * into making __SIZE_TYPE__ signed.
16 #define unsigned signed
17 typedef __SIZE_TYPE__ ssize_t
;
21 typedef unsigned int wint_t;
23 #define NULL ((void *)0)
25 /* The devicetree data structures are only mutable in ramstage. All other
26 stages have a constant devicetree. */
28 #define DEVTREE_EARLY 1
30 #define DEVTREE_EARLY 0
34 #define DEVTREE_CONST const
39 /* Work around non-writable data segment in execute-in-place romstage on x86. */
40 #if defined(__PRE_RAM__) && IS_ENABLED(CONFIG_ARCH_X86)
43 #define MAYBE_STATIC static
47 /* Provide a pointer to address 0 that thwarts any "accessing this is
48 * undefined behaviour and do whatever" trickery in compilers.
49 * Use when you _really_ need to read32(zeroptr) (ie. read address 0).
51 extern char zeroptr
[];