Raymond Mao | 87010c3 | 2024-10-03 14:50:15 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | |
| 3 | #ifndef _LIMITS_H |
| 4 | #define _LIMITS_H |
| 5 | |
| 6 | #define INT_MAX 0x7fffffff |
| 7 | #define UINT_MAX 0xffffffffU |
| 8 | #define CHAR_BIT 8 |
| 9 | #define UINT32_MAX 0xffffffffU |
| 10 | #define UINT64_MAX 0xffffffffffffffffULL |
| 11 | |
| 12 | #ifdef CONFIG_64BIT |
| 13 | #define UINTPTR_MAX UINT64_MAX |
| 14 | #else |
| 15 | #define UINTPTR_MAX UINT32_MAX |
| 16 | #endif |
| 17 | |
| 18 | #ifndef SIZE_MAX |
| 19 | #define SIZE_MAX UINTPTR_MAX |
| 20 | #endif |
| 21 | #ifndef SSIZE_MAX |
| 22 | #define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1)) |
| 23 | #endif |
| 24 | |
| 25 | #endif /* _LIMITS_H */ |