diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2022-07-12 18:47:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-12 12:47:25 -0400 |
| commit | 7564502b0bd065e7133350e3c9eebc23b9585ff6 (patch) | |
| tree | 9077dfe72f7845d34c424419885275d7a03cc8fb /include/libc | |
| parent | 2f07874a5f8e130986a0bd4c46d680ea284e19ea (diff) | |
Use intptr types in a few specific boot files (#1301)
* Add stdint.h with intptr_t and uinptr_t
* Use intptr types in dmamgr and yaz0
* Use intptr types in stackcheck
* Use intptr types in idle
* Run formatter
* Use pointers for StackEntry (+ minor type fix)
Diffstat (limited to 'include/libc')
| -rw-r--r-- | include/libc/stddef.h | 2 | ||||
| -rw-r--r-- | include/libc/stdint.h | 26 |
2 files changed, 26 insertions, 2 deletions
diff --git a/include/libc/stddef.h b/include/libc/stddef.h index b8c9859b0..d277a2603 100644 --- a/include/libc/stddef.h +++ b/include/libc/stddef.h @@ -5,8 +5,6 @@ typedef unsigned long size_t; -typedef unsigned int uintptr_t; - #ifdef __GNUC__ #define offsetof(structure, member) __builtin_offsetof (structure, member) #else diff --git a/include/libc/stdint.h b/include/libc/stdint.h new file mode 100644 index 000000000..6d8777439 --- /dev/null +++ b/include/libc/stdint.h @@ -0,0 +1,26 @@ +#ifndef STDINT_H +#define STDINT_H + +typedef signed int intptr_t; +typedef unsigned int uintptr_t; + +#define INT8_MIN (-0x80) +#define INT16_MIN (-0x8000) +#define INT32_MIN (-0x80000000) +#define INT64_MIN (-0x8000000000000000) + +#define INT8_MAX 0x7F +#define INT16_MAX 0x7FFF +#define INT32_MAX 0x7FFFFFFF +#define INT64_MAX 0x7FFFFFFFFFFFFFFF + +#define UINT8_MAX 0xFF +#define UINT16_MAX 0xFFFF +#define UINT32_MAX 0xFFFFFFFF +#define UINT64_MAX 0xFFFFFFFFFFFFFFFF + +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX + +#endif |
