]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/Include/limits.h
ArmPkg/PL390Gic: Populate the GIC Distributor Target Register with the GIC CPU ID...
[mirror_edk2.git] / StdLib / Include / limits.h
CommitLineData
2aa62f2b 1/** @file\r
2 The header <limits.h> defines several macros that expand to various limits and\r
3 parameters of the standard integer types.\r
4\r
59d13433 5 The values given below are constant expressions suitable for\r
6 use in #if preprocessing directives. Except for CHAR_BIT and\r
7 MB_LEN_MAX, they have the same\r
2aa62f2b 8 type as would an expression that is an object of the corresponding type\r
59d13433 9 converted according to the integer promotions.\r
10\r
a7a8363d 11 Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
2aa62f2b 12 This program and the accompanying materials are licensed and made available under\r
13 the terms and conditions of the BSD License that accompanies this distribution.\r
14 The full text of the license may be found at\r
59d13433 15 http://opensource.org/licenses/bsd-license.\r
2aa62f2b 16\r
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
2aa62f2b 19**/\r
20#ifndef _LIMITS_H\r
21#define _LIMITS_H\r
22#include <sys/EfiCdefs.h>\r
23#include <Library/PcdLib.h>\r
24\r
25/* Get the architecturally defined limits for this compilation unit. */\r
26#include <machine/limits.h>\r
27\r
59d13433 28/* Define the values required by the ISO/IEC 9899 Specification. */\r
2aa62f2b 29\r
59d13433 30/** Maximum number of bytes in a multibyte character, for any supported locale. **/\r
a7a8363d 31#define MB_LEN_MAX 4 /* UTF-8 can require up to 4 bytes */\r
2aa62f2b 32\r
59d13433 33/** Number of bits comprising the smallest object that is not a bit-field (byte). **/\r
2aa62f2b 34#define CHAR_BIT __CHAR_BIT\r
35\r
59d13433 36/** Minimum value for an object of type signed char. **/\r
2aa62f2b 37#define SCHAR_MIN __SCHAR_MIN\r
38\r
59d13433 39/** Maximum value for an object of type signed char. **/\r
2aa62f2b 40#define SCHAR_MAX __SCHAR_MAX\r
41\r
59d13433 42/** Maximum value for an object of type unsigned char. **/\r
2aa62f2b 43#define UCHAR_MAX __UCHAR_MAX\r
44\r
45#ifdef __CHAR_UNSIGNED__\r
59d13433 46 /** Maximum value for an object of type char. **/\r
2aa62f2b 47 #define CHAR_MAX UCHAR_MAX\r
59d13433 48 /** Minimum value for an object of type char. **/\r
2aa62f2b 49 #define CHAR_MIN 0\r
50#else\r
59d13433 51 /** Maximum value for an object of type char. **/\r
2aa62f2b 52 #define CHAR_MAX SCHAR_MAX\r
59d13433 53 /** Minimum value for an object of type char. **/\r
2aa62f2b 54 #define CHAR_MIN SCHAR_MIN\r
55#endif\r
56\r
59d13433 57/** Minimum value for an object of type short int. **/\r
2aa62f2b 58#define SHRT_MIN __SHRT_MIN\r
59\r
59d13433 60/** Maximum value for an object of type short int. **/\r
2aa62f2b 61#define SHRT_MAX __SHRT_MAX\r
62\r
59d13433 63/** Maximum value for an object of type unsigned short int. **/\r
2aa62f2b 64#define USHRT_MAX __USHRT_MAX\r
65\r
59d13433 66/** Minimum value for an object of type int. **/\r
2aa62f2b 67#define INT_MIN __INT_MIN\r
68\r
59d13433 69/** Maximum value for an object of type int. **/\r
2aa62f2b 70#define INT_MAX __INT_MAX\r
71\r
59d13433 72/** Maximum value for an object of type unsigned int. **/\r
2aa62f2b 73#define UINT_MAX __UINT_MAX\r
74\r
59d13433 75/** Minimum value for an object of type long int. **/\r
2aa62f2b 76#define LONG_MIN __LONG_MIN\r
77\r
59d13433 78/** Maximum value for an object of type long int. **/\r
2aa62f2b 79#define LONG_MAX __LONG_MAX\r
80\r
59d13433 81/** Maximum value for an object of type unsigned long int. **/\r
2aa62f2b 82#define ULONG_MAX __ULONG_MAX\r
83\r
59d13433 84/** Minimum value for an object of type long long int. **/\r
2aa62f2b 85#define LLONG_MIN __LLONG_MIN\r
86\r
59d13433 87/** Maximum value for an object of type long long int. **/\r
2aa62f2b 88#define LLONG_MAX __LLONG_MAX\r
89\r
59d13433 90/** Maximum value for an object of type unsigned long long int. **/\r
2aa62f2b 91#define ULLONG_MAX __ULLONG_MAX\r
92\r
93/* Object limits used in the Standard Libraries */\r
94#if (PcdGet32(PcdMaximumAsciiStringLength) > 0)\r
59d13433 95 /** Maximum length of an arbitrary "narrow-character" string. **/\r
2aa62f2b 96 #define ASCII_STRING_MAX PcdGet32(PcdMaximumAsciiStringLength)\r
97#else\r
59d13433 98 /** Maximum length of an arbitrary "narrow-character" string. **/\r
2aa62f2b 99 #define ASCII_STRING_MAX 256\r
100#endif\r
101\r
102#if (PcdGet32(PcdMaximumUnicodeStringLength) > 0)\r
59d13433 103 /** Maximum length of an arbitrary "wide-character" string. **/\r
2aa62f2b 104 #define UNICODE_STRING_MAX PcdGet32(PcdMaximumUnicodeStringLength)\r
105#else\r
59d13433 106 /** Maximum length of an arbitrary "wide-character" string. **/\r
2aa62f2b 107 #define UNICODE_STRING_MAX 512\r
108#endif\r
109\r
110/* Limits for BSD Compatibility */\r
111#define NL_TEXTMAX 2048\r
59d13433 112\r
2aa62f2b 113#include <sys/syslimits.h>\r
114\r
115#endif /* _LIMITS_H */\r