]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg DxeCore: Add OEM reserved memory type support.
authorStar Zeng <star.zeng@intel.com>
Mon, 18 May 2015 01:28:24 +0000 (01:28 +0000)
committerlzeng14 <lzeng14@Edk2>
Mon, 18 May 2015 01:28:24 +0000 (01:28 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17460 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Mem/Imem.h
MdeModulePkg/Core/Dxe/Mem/Page.c
MdeModulePkg/Core/Dxe/Mem/Pool.c

index 16077d825debcf69adaac645396dda190ab669e7..7f906832182de60abe3e855132e6e8243fa16a3c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Data structure and functions to allocate and free memory space.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,6 +40,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #endif\r
 \r
+//\r
+// +---------------------------------------------------+\r
+// | 0..(EfiMaxMemoryType - 1)    - Normal memory type |\r
+// +---------------------------------------------------+\r
+// | EfiMaxMemoryType..0x6FFFFFFF - Ilegal             |\r
+// +---------------------------------------------------+\r
+// | 0x70000000..0x7FFFFFFF       - OEM reserved       |\r
+// +---------------------------------------------------+\r
+// | 0x80000000..0xFFFFFFFF       - OS reserved        |\r
+// +---------------------------------------------------+\r
+//\r
+#define MEMORY_TYPE_OS_RESERVED_MIN                 0x80000000\r
+#define MEMORY_TYPE_OS_RESERVED_MAX                 0xFFFFFFFF\r
+#define MEMORY_TYPE_OEM_RESERVED_MIN                0x70000000\r
+#define MEMORY_TYPE_OEM_RESERVED_MAX                0x7FFFFFFF\r
 \r
 //\r
 // MEMORY_MAP_ENTRY\r
index 855ac8915f9a1804c30646c50ef6e994c398fb16..a92c865e171677d1e196ff7c529e19d6d163d944 100644 (file)
@@ -544,7 +544,7 @@ CoreAddMemoryDescriptor (
     return;\r
   }\r
 \r
-  if (Type >= EfiMaxMemoryType && Type <= 0x7fffffff) {\r
+  if (Type >= EfiMaxMemoryType && Type < MEMORY_TYPE_OEM_RESERVED_MIN) {\r
     return;\r
   }\r
   CoreAcquireMemoryLock ();\r
@@ -1203,7 +1203,7 @@ CoreInternalAllocatePages (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((MemoryType >= EfiMaxMemoryType && MemoryType <= 0x7fffffff) ||\r
+  if ((MemoryType >= EfiMaxMemoryType && MemoryType < MEMORY_TYPE_OEM_RESERVED_MIN) ||\r
        (MemoryType == EfiConventionalMemory) || (MemoryType == EfiPersistentMemory)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
index ac717fb65f7a3a50da948bb01e67a356a4c6bf53..e5fee1abfc56dec170008f9075d14771c1b7e1e0 100644 (file)
@@ -154,10 +154,11 @@ LookupPoolHead (
   }\r
 \r
   //\r
-  // MemoryType values in the range 0x80000000..0xFFFFFFFF are reserved for use by UEFI \r
-  // OS loaders that are provided by operating system vendors\r
+  // MemoryType values in the range 0x80000000..0xFFFFFFFF are reserved for use by UEFI\r
+  // OS loaders that are provided by operating system vendors.\r
+  // MemoryType values in the range 0x70000000..0x7FFFFFFF are reserved for OEM use.\r
   //\r
-  if ((INT32)MemoryType < 0) {\r
+  if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {\r
 \r
     for (Link = mPoolHeadList.ForwardLink; Link != &mPoolHeadList; Link = Link->ForwardLink) {\r
       Pool = CR(Link, POOL, Link, POOL_SIGNATURE);\r
@@ -215,7 +216,7 @@ CoreInternalAllocatePool (
   //\r
   // If it's not a valid type, fail it\r
   //\r
-  if ((PoolType >= EfiMaxMemoryType && PoolType <= 0x7fffffff) ||\r
+  if ((PoolType >= EfiMaxMemoryType && PoolType < MEMORY_TYPE_OEM_RESERVED_MIN) ||\r
        (PoolType == EfiConventionalMemory) || (PoolType == EfiPersistentMemory)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r