summaryrefslogtreecommitdiff
path: root/StdLib/Include/x86/limits.h
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-27 21:42:16 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-27 21:42:16 +0000
commit2aa62f2bc9a9654687b377d9ca8a8c2c860a3852 (patch)
tree62a0991a44327154fb88bf95bd6f7522053db7bb /StdLib/Include/x86/limits.h
parent98790d814871cc30bbd536673d3a0948047cd2f0 (diff)
downloadedk2-platforms-2aa62f2bc9a9654687b377d9ca8a8c2c860a3852.tar.xz
Standard Libraries for EDK II.
This set of three packages: AppPkg, StdLib, StdLibPrivateInternalFiles; contains the implementation of libraries based upon non-UEFI standards such as ISO/IEC-9899, the library portion of the C Language Standard, POSIX, etc. AppPkg contains applications that make use of the standard libraries defined in the StdLib Package. StdLib contains header (include) files and the implementations of the standard libraries. StdLibPrivateInternalFiles contains files for the exclusive use of the library implementations in StdLib. These files should never be directly referenced from applications or other code. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11600 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/Include/x86/limits.h')
-rw-r--r--StdLib/Include/x86/limits.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/StdLib/Include/x86/limits.h b/StdLib/Include/x86/limits.h
new file mode 100644
index 0000000000..19d7963e2a
--- /dev/null
+++ b/StdLib/Include/x86/limits.h
@@ -0,0 +1,77 @@
+/** @file
+ Machine specific values for <limits.h>.
+
+ Within this file, the ^ character is used in comments to represent exponentiation.
+ Thus, 2^7 means "2 to the 7th power", NOT "2 XOR 7".
+
+ Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+#ifndef _MACHINE_LIMITS_H
+#define _MACHINE_LIMITS_H
+
+/** Number of bits for smallest object that is not a bit-field (byte). **/
+#define __CHAR_BIT 8
+
+/** minimum value for an object of type signed char **/
+#define __SCHAR_MIN -128 // -(2^7 - 1)
+
+/** maximum value for an object of type signed char **/
+#define __SCHAR_MAX +127 // 2^7 - 1
+
+/** maximum value for an object of type unsigned char **/
+#define __UCHAR_MAX 255 // 2^8 - 1
+
+/** minimum value for an object of type short int **/
+#define __SHRT_MIN -32768 // -(2^15 - 1)
+
+/** maximum value for an object of type short int **/
+#define __SHRT_MAX +32767 // 2^15 - 1
+
+/** maximum value for an object of type unsigned short int **/
+#define __USHRT_MAX 65535 // 2^16 - 1
+
+/** maximum value for an object of type int **/
+#define __INT_MAX +2147483647 // 2^31 - 1
+
+/** minimum value for an object of type int **/
+#define __INT_MIN (-2147483647 - 1) // -(2^31 - 1)
+
+/** maximum value for an object of type unsigned int **/
+#define __UINT_MAX 0xffffffff // 2^32 - 1
+
+/** minimum value for an object of type long int **/
+#define __LONG_MIN (-2147483647L - 1L) // -(2^31 - 1)
+
+/** maximum value for an object of type long int **/
+#define __LONG_MAX +2147483647L // 2^31 - 1
+
+/** maximum value for an object of type unsigned long int **/
+#define __ULONG_MAX 0xffffffff // 2^32 - 1
+
+/** minimum value for an object of type long long int **/
+//#define __LLONG_MIN -9223372036854775808LL // -(2^63 - 1)
+//#define __LLONG_MIN ((-9223372036854775807LL)-1) // -(2^63 - 1)
+#define __LLONG_MIN (-9223372036854775807LL - 1LL) // -(2^63 - 1)
+
+/** maximum value for an object of type long long int **/
+#define __LLONG_MAX 9223372036854775807LL // 2^63 - 1
+
+/** maximum value for an object of type unsigned long long int **/
+//#define __ULLONG_MAX 18446744073709551615ULL // 2^64 - 1
+#define __ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL // 2^64 - 1
+
+/* Intel extensions to <limits.h> for UEFI */
+#define __SHORT_BIT 16
+#define __WCHAR_BIT 16
+#define __INT_BIT 32
+#define __LONG_BIT 32 /* Compiler dependent */
+#define __LONG_LONG_BIT 64
+
+#endif /* _MACHINE_LIMITS_H */