]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/CommonLib: drop the use of MAX_ADDRESS
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 5 Dec 2018 08:15:48 +0000 (09:15 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 6 Dec 2018 07:32:00 +0000 (08:32 +0100)
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>
BaseTools/Source/C/Common/CommonLib.c
BaseTools/Source/C/Include/AArch64/ProcessorBind.h
BaseTools/Source/C/Include/Arm/ProcessorBind.h
BaseTools/Source/C/Include/Common/UefiBaseTypes.h
BaseTools/Source/C/Include/Ia32/ProcessorBind.h
BaseTools/Source/C/Include/X64/ProcessorBind.h

index 42dfa821624d4de40eda7b6fe1fdd7ffe5e59156..5c40fdb5fd491ac9eda8356cc9e5a2580b98f978 100644 (file)
@@ -1236,7 +1236,6 @@ InternalAllocateCopyPool (
   VOID  *Memory;\r
 \r
   ASSERT (Buffer != NULL);\r
   VOID  *Memory;\r
 \r
   ASSERT (Buffer != NULL);\r
-  ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));\r
 \r
   Memory = malloc (AllocationSize);\r
   if (Memory != NULL) {\r
 \r
   Memory = malloc (AllocationSize);\r
   if (Memory != NULL) {\r
index e7e9d83198a6aefd2c01a713af1520ccf4b87450..f956cab453f033f1192a0d682014475213f2ab27 100644 (file)
@@ -90,11 +90,6 @@ typedef INT64   INTN;
 ///\r
 #define MAX_2_BITS   0xC000000000000000\r
 \r
 ///\r
 #define MAX_2_BITS   0xC000000000000000\r
 \r
-///\r
-/// Maximum legal AARCH64  address\r
-///\r
-#define MAX_ADDRESS  0xFFFFFFFFFFFFFFFF\r
-\r
 ///\r
 /// The stack alignment required for AARCH64\r
 ///\r
 ///\r
 /// The stack alignment required for AARCH64\r
 ///\r
index be4aac97664dcecabfab57bf3ab246126a2c1b3c..856d2bd9eff7de2127b6d202342f601e1e9a9ab0 100644 (file)
@@ -88,11 +88,6 @@ typedef INT32   INTN;
 ///\r
 #define MAX_2_BITS   0xC0000000\r
 \r
 ///\r
 #define MAX_2_BITS   0xC0000000\r
 \r
-///\r
-/// Maximum legal ARM address\r
-///\r
-#define MAX_ADDRESS  0xFFFFFFFF\r
-\r
 ///\r
 /// The stack alignment required for ARM\r
 ///\r
 ///\r
 /// The stack alignment required for ARM\r
 ///\r
index aa1aef3ce638f94160edf25396d2c2b14e7c8967..696ac15e4cd54b1669bed3143a31424eea980761 100644 (file)
@@ -170,6 +170,5 @@ typedef union {
 \r
 \r
 #define EFI_MAX_BIT               MAX_BIT\r
 \r
 \r
 #define EFI_MAX_BIT               MAX_BIT\r
-#define EFI_MAX_ADDRESS           MAX_ADDRESS\r
 \r
 #endif\r
 \r
 #endif\r
index 4719b53d37fadc6762d2ad427ffea3719e8598b7..96ac691df042c1ac3ad914a1901b72cbce675173 100644 (file)
@@ -131,11 +131,6 @@ typedef INT32   INTN;
 #define MAX_BIT     0x80000000\r
 #define MAX_2_BITS  0xC0000000\r
 \r
 #define MAX_BIT     0x80000000\r
 #define MAX_2_BITS  0xC0000000\r
 \r
-//\r
-// Maximum legal IA-32 address\r
-//\r
-#define MAX_ADDRESS   0xFFFFFFFF\r
-\r
 //\r
 // Modifier to ensure that all protocol member functions and EFI intrinsics\r
 // use the correct C calling convention. All protocol member functions and\r
 //\r
 // Modifier to ensure that all protocol member functions and EFI intrinsics\r
 // use the correct C calling convention. All protocol member functions and\r
index c625f8cef4a1f6e6222b550ef84020a350aad9ea..987738508333e00c8a88b5b1230625d377be9fa6 100644 (file)
@@ -150,11 +150,6 @@ typedef INT64   INTN;
 #define MAX_BIT     0x8000000000000000ULL\r
 #define MAX_2_BITS  0xC000000000000000ULL\r
 \r
 #define MAX_BIT     0x8000000000000000ULL\r
 #define MAX_2_BITS  0xC000000000000000ULL\r
 \r
-//\r
-// Maximum legal Itanium-based address\r
-//\r
-#define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL\r
-\r
 //\r
 // Modifier to ensure that all protocol member functions and EFI intrinsics\r
 // use the correct C calling convention. All protocol member functions and\r
 //\r
 // Modifier to ensure that all protocol member functions and EFI intrinsics\r
 // use the correct C calling convention. All protocol member functions and\r