/** @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
\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
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
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
}\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
//\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