reset: Convert individual boards to `board_reset()`
[coreboot.git] / src / include / stddef.h
blob5df773541861564e350d3437df377e376b9da97a
1 #ifndef STDDEF_H
2 #define STDDEF_H
4 #include <commonlib/helpers.h>
5 #include <rules.h>
7 typedef long ptrdiff_t;
8 #ifndef __SIZE_TYPE__
9 #define __SIZE_TYPE__ unsigned long
10 #endif
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;
18 #undef unsigned
20 typedef int wchar_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. */
27 #if !ENV_RAMSTAGE
28 #define DEVTREE_EARLY 1
29 #else
30 #define DEVTREE_EARLY 0
31 #endif
33 #if DEVTREE_EARLY
34 #define DEVTREE_CONST const
35 #else
36 #define DEVTREE_CONST
37 #endif
39 /* Work around non-writable data segment in execute-in-place romstage on x86. */
40 #if defined(__PRE_RAM__) && IS_ENABLED(CONFIG_ARCH_X86)
41 #define MAYBE_STATIC
42 #else
43 #define MAYBE_STATIC static
44 #endif
46 #ifndef __ROMCC__
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[];
52 #endif
54 #endif /* STDDEF_H */