5 #ifndef OPENTITAN_SW_DEVICE_LIB_BASE_FREESTANDING_STDINT_H_
6 #define OPENTITAN_SW_DEVICE_LIB_BASE_FREESTANDING_STDINT_H_
31 typedef __UINT8_TYPE__ uint8_t;
32 typedef __UINT16_TYPE__ uint16_t;
33 typedef __UINT32_TYPE__ uint32_t;
34 typedef __UINT64_TYPE__ uint64_t;
35 typedef __INT8_TYPE__ int8_t;
36 typedef __INT16_TYPE__ int16_t;
37 typedef __INT32_TYPE__ int32_t;
38 typedef __INT64_TYPE__ int64_t;
40 typedef __UINT_LEAST8_TYPE__ uint_least8_t;
41 typedef __UINT_LEAST16_TYPE__ uint_least16_t;
42 typedef __UINT_LEAST32_TYPE__ uint_least32_t;
43 typedef __UINT_LEAST64_TYPE__ uint_least64_t;
44 typedef __INT_LEAST8_TYPE__ int_least8_t;
45 typedef __INT_LEAST16_TYPE__ int_least16_t;
46 typedef __INT_LEAST32_TYPE__ int_least32_t;
47 typedef __INT_LEAST64_TYPE__ int_least64_t;
49 typedef __UINT_FAST8_TYPE__ uint_fast8_t;
50 typedef __UINT_FAST16_TYPE__ uint_fast16_t;
51 typedef __UINT_FAST32_TYPE__ uint_fast32_t;
52 typedef __UINT_FAST64_TYPE__ uint_fast64_t;
53 typedef __INT_FAST8_TYPE__ int_fast8_t;
54 typedef __INT_FAST16_TYPE__ int_fast16_t;
55 typedef __INT_FAST32_TYPE__ int_fast32_t;
56 typedef __INT_FAST64_TYPE__ int_fast64_t;
58 typedef __UINTPTR_TYPE__ uintptr_t;
59 typedef __INTPTR_TYPE__ intptr_t;
61 typedef __UINTMAX_TYPE__ uintmax_t;
62 typedef __INTMAX_TYPE__ intmax_t;
69 #define INT8_MIN (-__INT8_MAX__ - 1)
70 #define INT8_MAX __INT8_MAX__
71 #define UINT8_MAX __UINT8_MAX__
72 #define INT16_MIN (-__INT16_MAX__ - 1)
73 #define INT16_MAX __INT16_MAX__
74 #define UINT16_MAX __UINT16_MAX__
75 #define INT32_MIN (-__INT32_MAX__ - 1)
76 #define INT32_MAX __INT32_MAX__
77 #define UINT32_MAX __UINT32_MAX__
78 #define INT64_MIN (-__INT64_MAX__ - 1)
79 #define INT64_MAX __INT64_MAX__
80 #define UINT64_MAX __UINT64_MAX__
82 #define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1)
83 #define INT_LEAST8_MAX __INT_LEAST8_MAX__
84 #define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
85 #define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1)
86 #define INT_LEAST16_MAX __INT_LEAST16_MAX__
87 #define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
88 #define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1)
89 #define INT_LEAST32_MAX __INT_LEAST32_MAX__
90 #define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
91 #define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1)
92 #define INT_LEAST64_MAX __INT_LEAST64_MAX__
93 #define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
95 #define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1)
96 #define INT_FAST8_MAX __INT_FAST8_MAX__
97 #define UINT_FAST8_MAX __UINT_FAST8_MAX__
98 #define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1)
99 #define INT_FAST16_MAX __INT_FAST16_MAX__
100 #define UINT_FAST16_MAX __UINT_FAST16_MAX__
101 #define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1)
102 #define INT_FAST32_MAX __INT_FAST32_MAX__
103 #define UINT_FAST32_MAX __UINT_FAST32_MAX__
104 #define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1)
105 #define INT_FAST64_MAX __INT_FAST64_MAX__
106 #define UINT_FAST64_MAX __UINT_FAST64_MAX__
108 #define INTPTR_MIN (-__INTPTR_MAX__ - 1)
109 #define INTPTR_MAX __INTPTR_MAX__
110 #define UINTPTR_MAX __UINTPTR_MAX__
112 #define INTMAX_MIN (-__INTMAX_MAX__ - 1)
113 #define INTMAX_MAX __INTMAX_MAX__
114 #define UINTMAX_MAX __UINTMAX_MAX__
116 #define PTRDIFF_MIN (-__PTRDIFF_MAX__ - 1)
117 #define PTRDIFF_MAX __PTRDIFF_MAX__
119 #define SIZE_MAX __SIZE_MAX__
121 #define WCHAR_MIN (-__WCHAR_MAX__ - 1)
122 #define WCHAR_MAX __WCHAR_MAX__
128 #define INT8_C(value) (value)
129 #define INT16_C(value) (value)
130 #define INT32_C(value) (value)
131 #define INT64_C(value) (value##LL)
132 #define INTMAX_C(value) (value##LL)
134 #define UINT8_C(value) (value##U)
135 #define UINT16_C(value) (value##U)
136 #define UINT32_C(value) (value##U)
137 #define UINT64_C(value) (value##ULL)
138 #define UINTMAX_C(value) (value##ULL)