]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /** @file\r |
59d13433 | 2 | Intel x86 architecture (both Ia32 and X64) specific values for <limits.h>.\r |
2aa62f2b | 3 | \r |
4 | Within this file, the ^ character is used in comments to represent exponentiation.\r | |
5 | Thus, 2^7 means "2 to the 7th power", NOT "2 XOR 7".\r | |
6 | \r | |
59d13433 | 7 | Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r |
2aa62f2b | 8 | This program and the accompanying materials are licensed and made available under\r |
9 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
10 | The full text of the license may be found at\r | |
59d13433 | 11 | http://opensource.org/licenses/bsd-license.\r |
2aa62f2b | 12 | \r |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | **/\r | |
16 | #ifndef _MACHINE_LIMITS_H\r | |
17 | #define _MACHINE_LIMITS_H\r | |
18 | \r | |
19 | /** Number of bits for smallest object that is not a bit-field (byte). **/\r | |
20 | #define __CHAR_BIT 8\r | |
21 | \r | |
59d13433 | 22 | /** Minimum value for an object of type signed char. **/\r |
2aa62f2b | 23 | #define __SCHAR_MIN -128 // -(2^7 - 1)\r |
24 | \r | |
59d13433 | 25 | /** Maximum value for an object of type signed char. **/\r |
2aa62f2b | 26 | #define __SCHAR_MAX +127 // 2^7 - 1\r |
27 | \r | |
59d13433 | 28 | /** Maximum value for an object of type unsigned char. **/\r |
2aa62f2b | 29 | #define __UCHAR_MAX 255 // 2^8 - 1\r |
30 | \r | |
59d13433 | 31 | /** Minimum value for an object of type short int. **/\r |
2aa62f2b | 32 | #define __SHRT_MIN -32768 // -(2^15 - 1)\r |
33 | \r | |
59d13433 | 34 | /** Maximum value for an object of type short int. **/\r |
2aa62f2b | 35 | #define __SHRT_MAX +32767 // 2^15 - 1\r |
36 | \r | |
59d13433 | 37 | /** Maximum value for an object of type unsigned short int. **/\r |
2aa62f2b | 38 | #define __USHRT_MAX 65535 // 2^16 - 1\r |
39 | \r | |
59d13433 | 40 | /** Maximum value for an object of type int. **/\r |
2aa62f2b | 41 | #define __INT_MAX +2147483647 // 2^31 - 1\r |
42 | \r | |
59d13433 | 43 | /** Minimum value for an object of type int. **/\r |
2aa62f2b | 44 | #define __INT_MIN (-2147483647 - 1) // -(2^31 - 1)\r |
45 | \r | |
59d13433 | 46 | /** Maximum value for an object of type unsigned int. **/\r |
2aa62f2b | 47 | #define __UINT_MAX 0xffffffff // 2^32 - 1\r |
48 | \r | |
59d13433 | 49 | /** Minimum value for an object of type long long int. **/\r |
50 | #define __LLONG_MIN (-9223372036854775807LL - 1LL) // -(2^63 - 1)\r | |
2aa62f2b | 51 | \r |
59d13433 | 52 | /** Maximum value for an object of type long long int. **/\r |
2aa62f2b | 53 | #define __LLONG_MAX 9223372036854775807LL // 2^63 - 1\r |
54 | \r | |
59d13433 | 55 | /** Maximum value for an object of type unsigned long long int. **/\r |
2aa62f2b | 56 | #define __ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL // 2^64 - 1\r |
57 | \r | |
59d13433 | 58 | /** Intel extensions to <limits.h> for UEFI\r |
59 | @{\r | |
60 | **/\r | |
61 | #define __SHORT_BIT 16 ///< Number of bits comprising a short int.\r | |
62 | #define __WCHAR_BIT 16 ///< Number of bits comprising a wide character.\r | |
63 | #define __INT_BIT 32 ///< Number of bits comprising an int.\r | |
64 | #define __LONG_LONG_BIT 64 ///< Number of bits comprising a long long int.\r | |
65 | /// @}\r | |
2aa62f2b | 66 | \r |
67 | #endif /* _MACHINE_LIMITS_H */\r |