summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-12-05 09:15:48 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-12-06 08:32:00 +0100
commit67938bcc9d9ed7b1867d29e47f3547bdf299f8c6 (patch)
tree423f764c0324121b0484cf6576ea3b02dc2a26fc /BaseTools
parent6e8cad49a09db38c309b19b930ba568d2953a901 (diff)
downloadedk2-67938bcc9d9ed7b1867d29e47f3547bdf299f8c6.zip
edk2-67938bcc9d9ed7b1867d29e47f3547bdf299f8c6.tar.gz
edk2-67938bcc9d9ed7b1867d29e47f3547bdf299f8c6.tar.bz2
BaseTools/CommonLib: drop the use of MAX_ADDRESS
The macro MAX_ADDRESS represents the largest virtual address that is valid for a certain architecture. For the BaseTools, this quantity is irrelevant, since the same tools can be used to build for different targets. Since we only refer to it in a single place, which is an ASSERT() that doesn't seem particularly useful (it ensures that memcpy() will not be called with arguments that will make it read beyond the end of the address space and wrap around), let's drop the ASSERT and all references to MAX_ADDRESS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/C/Common/CommonLib.c1
-rw-r--r--BaseTools/Source/C/Include/AArch64/ProcessorBind.h5
-rw-r--r--BaseTools/Source/C/Include/Arm/ProcessorBind.h5
-rw-r--r--BaseTools/Source/C/Include/Common/UefiBaseTypes.h1
-rw-r--r--BaseTools/Source/C/Include/Ia32/ProcessorBind.h5
-rw-r--r--BaseTools/Source/C/Include/X64/ProcessorBind.h5
6 files changed, 0 insertions, 22 deletions
diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c
index 42dfa82..5c40fdb 100644
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ b/BaseTools/Source/C/Common/CommonLib.c
@@ -1236,7 +1236,6 @@ InternalAllocateCopyPool (
VOID *Memory;
ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
Memory = malloc (AllocationSize);
if (Memory != NULL) {
diff --git a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
index e7e9d83..f956cab 100644
--- a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
+++ b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
@@ -91,11 +91,6 @@ typedef INT64 INTN;
#define MAX_2_BITS 0xC000000000000000
///
-/// Maximum legal AARCH64 address
-///
-#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
-
-///
/// The stack alignment required for AARCH64
///
#define CPU_STACK_ALIGNMENT 16
diff --git a/BaseTools/Source/C/Include/Arm/ProcessorBind.h b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
index be4aac9..856d2bd 100644
--- a/BaseTools/Source/C/Include/Arm/ProcessorBind.h
+++ b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
@@ -89,11 +89,6 @@ typedef INT32 INTN;
#define MAX_2_BITS 0xC0000000
///
-/// Maximum legal ARM address
-///
-#define MAX_ADDRESS 0xFFFFFFFF
-
-///
/// The stack alignment required for ARM
///
#define CPU_STACK_ALIGNMENT sizeof(UINT64)
diff --git a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
index aa1aef3..696ac15 100644
--- a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
+++ b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
@@ -170,6 +170,5 @@ typedef union {
#define EFI_MAX_BIT MAX_BIT
-#define EFI_MAX_ADDRESS MAX_ADDRESS
#endif
diff --git a/BaseTools/Source/C/Include/Ia32/ProcessorBind.h b/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
index 4719b53..96ac691 100644
--- a/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
+++ b/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
@@ -132,11 +132,6 @@ typedef INT32 INTN;
#define MAX_2_BITS 0xC0000000
//
-// Maximum legal IA-32 address
-//
-#define MAX_ADDRESS 0xFFFFFFFF
-
-//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify their member functions with EFIAPI.
diff --git a/BaseTools/Source/C/Include/X64/ProcessorBind.h b/BaseTools/Source/C/Include/X64/ProcessorBind.h
index c625f8c..9877385 100644
--- a/BaseTools/Source/C/Include/X64/ProcessorBind.h
+++ b/BaseTools/Source/C/Include/X64/ProcessorBind.h
@@ -151,11 +151,6 @@ typedef INT64 INTN;
#define MAX_2_BITS 0xC000000000000000ULL
//
-// Maximum legal Itanium-based address
-//
-#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
-
-//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify thier member functions with EFIAPI.