summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff>2013-09-11 02:08:07 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2013-09-11 02:08:07 +0000
commit13d720ceb071144513f248fd091aefc1c92e49fb (patch)
tree0d8453316c82601d18b59b9a1c9b0c64b7f924ce
parent914b326ec20a7d515198110a6dd570523c1d31c8 (diff)
downloadedk2-13d720ceb071144513f248fd091aefc1c92e49fb.zip
edk2-13d720ceb071144513f248fd091aefc1c92e49fb.tar.gz
edk2-13d720ceb071144513f248fd091aefc1c92e49fb.tar.bz2
Sync patch of patch r14465 from main trunk.
Add defines for MAX values for UEFI data types. git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2010.SR1@14649 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdePkg/Include/Arm/ProcessorBind.h8
-rw-r--r--MdePkg/Include/Base.h13
-rw-r--r--MdePkg/Include/Ia32/ProcessorBind.h8
-rw-r--r--MdePkg/Include/Ipf/ProcessorBind.h8
-rw-r--r--MdePkg/Include/X64/ProcessorBind.h8
5 files changed, 40 insertions, 5 deletions
diff --git a/MdePkg/Include/Arm/ProcessorBind.h b/MdePkg/Include/Arm/ProcessorBind.h
index fea42e9..4ec1cdc 100644
--- a/MdePkg/Include/Arm/ProcessorBind.h
+++ b/MdePkg/Include/Arm/ProcessorBind.h
@@ -1,7 +1,7 @@
/** @file
Processor or Compiler specific defines and types for ARM.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -93,6 +93,12 @@ typedef INT32 INTN;
#define MAX_ADDRESS 0xFFFFFFFF
///
+/// Maximum legal ARM INTN and UINTN values.
+///
+#define MAX_INTN ((INTN)0x7FFFFFFF)
+#define MAX_UINTN ((UINTN)0xFFFFFFFF)
+
+///
/// The stack alignment required for ARM
///
#define CPU_STACK_ALIGNMENT sizeof(UINT64)
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 66fc5d2..127a0bf 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -6,7 +6,7 @@
environment. There are a set of base libraries in the Mde Package that can
be used to implement base modules.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -206,6 +206,17 @@ struct _LIST_ENTRY {
///
#define NULL ((VOID *) 0)
+///
+/// Maximum values for common UEFI Data Types
+///
+#define MAX_INT8 ((INT8)0x7F)
+#define MAX_UINT8 ((UINT8)0xFF)
+#define MAX_INT16 ((INT16)0x7FFF)
+#define MAX_UINT16 ((UINT16)0xFFFF)
+#define MAX_INT32 ((INT32)0x7FFFFFFF)
+#define MAX_UINT32 ((UINT32)0xFFFFFFFF)
+#define MAX_INT64 ((INT64)0x7FFFFFFFFFFFFFFFULL)
+#define MAX_UINT64 ((UINT64)0xFFFFFFFFFFFFFFFFULL)
#define BIT0 0x00000001
#define BIT1 0x00000002
diff --git a/MdePkg/Include/Ia32/ProcessorBind.h b/MdePkg/Include/Ia32/ProcessorBind.h
index b38f39c..63e35b7 100644
--- a/MdePkg/Include/Ia32/ProcessorBind.h
+++ b/MdePkg/Include/Ia32/ProcessorBind.h
@@ -1,7 +1,7 @@
/** @file
Processor or Compiler specific defines and types for IA-32 architecture.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, 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
@@ -227,6 +227,12 @@ typedef INT32 INTN;
#define MAX_ADDRESS 0xFFFFFFFF
///
+/// Maximum legal IA-32 INTN and UINTN values.
+///
+#define MAX_INTN ((INTN)0x7FFFFFFF)
+#define MAX_UINTN ((UINTN)0xFFFFFFFF)
+
+///
/// The stack alignment required for IA-32.
///
#define CPU_STACK_ALIGNMENT sizeof(UINTN)
diff --git a/MdePkg/Include/Ipf/ProcessorBind.h b/MdePkg/Include/Ipf/ProcessorBind.h
index 07174fc..4e2120c 100644
--- a/MdePkg/Include/Ipf/ProcessorBind.h
+++ b/MdePkg/Include/Ipf/ProcessorBind.h
@@ -1,7 +1,7 @@
/** @file
Processor or Compiler specific defines and types for Intel Itanium(TM) processors.
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, 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 which accompanies this
distribution. The full text of the license may be found at
@@ -237,6 +237,12 @@ typedef INT64 INTN;
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
///
+/// Maximum legal Itanium-based INTN and UINTN values.
+///
+#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL)
+#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL)
+
+///
/// Per the Itanium Software Conventions and Runtime Architecture Guide,
/// section 3.3.4, IPF stack must always be 16-byte aligned.
///
diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h
index 974545a..ee63406 100644
--- a/MdePkg/Include/X64/ProcessorBind.h
+++ b/MdePkg/Include/X64/ProcessorBind.h
@@ -1,7 +1,7 @@
/** @file
Processor or Compiler specific defines and types x64 (Intel 64, AMD64).
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, 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
which accompanies this distribution. The full text of the license may be found at
@@ -228,6 +228,12 @@ typedef INT64 INTN;
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
///
+/// Maximum legal x64 INTN and UINTN values.
+///
+#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL)
+#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL)
+
+///
/// The stack alignment required for x64
///
#define CPU_STACK_ALIGNMENT 16