--- /dev/null
+/** @file \r
+ \r
+ Data structure and functions to allocate and free memory space.\r
+\r
+Copyright (c) 2006 - 2008, Intel Corporation \r
+All rights reserved. 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
+http://opensource.org/licenses/bsd-license.php \r
+ \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+\r
+**/\r
+\r
+#ifndef _IMEM_H_\r
+#define _IMEM_H_\r
+\r
+#if defined (MDE_CPU_IPF)\r
+//\r
+// For Itanium machines make the default allocations 8K aligned\r
+//\r
+#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE * 2)\r
+#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE * 2)\r
+\r
+#else\r
+//\r
+// For genric EFI machines make the default allocations 4K aligned\r
+//\r
+#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)\r
+#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE)\r
+\r
+#endif\r
+\r
+\r
+//\r
+// MEMORY_MAP_ENTRY\r
+//\r
+\r
+#define MEMORY_MAP_SIGNATURE EFI_SIGNATURE_32('m','m','a','p')\r
+typedef struct {\r
+ UINTN Signature;\r
+ LIST_ENTRY Link;\r
+ BOOLEAN FromPages;\r
+\r
+ EFI_MEMORY_TYPE Type;\r
+ UINT64 Start;\r
+ UINT64 End;\r
+\r
+ UINT64 VirtualStart;\r
+ UINT64 Attribute;\r
+} MEMORY_MAP;\r
+\r
+//\r
+// Internal prototypes\r
+//\r
+\r
+\r
+/**\r
+ Internal function. Used by the pool functions to allocate pages\r
+ to back pool allocation requests.\r
+\r
+ @param PoolType The type of memory for the new pool pages \r
+ @param NumberOfPages No of pages to allocate \r
+ @param Alignment Bits to align. \r
+\r
+ @return The allocated memory, or NULL\r
+\r
+**/\r
+VOID *\r
+CoreAllocatePoolPages (\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN NumberOfPages,\r
+ IN UINTN Alignment\r
+ )\r
+;\r
+\r
+\r
+\r
+/**\r
+ Internal function. Frees pool pages allocated via AllocatePoolPages ()\r
+\r
+ @param Memory The base address to free \r
+ @param NumberOfPages The number of pages to free\r
+\r
+**/\r
+VOID\r
+CoreFreePoolPages (\r
+ IN EFI_PHYSICAL_ADDRESS Memory,\r
+ IN UINTN NumberOfPages\r
+ )\r
+;\r
+\r
+\r
+\r
+/**\r
+ Internal function to allocate pool of a particular type.\r
+ Caller must have the memory lock held\r
+\r
+ @param PoolType Type of pool to allocate \r
+ @param Size The amount of pool to allocate \r
+\r
+ @return The allocate pool, or NULL\r
+\r
+**/\r
+VOID *\r
+CoreAllocatePoolI (\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN Size\r
+ )\r
+;\r
+\r
+\r
+\r
+/**\r
+ Internal function to free a pool entry.\r
+ Caller must have the memory lock held\r
+\r
+ @param Buffer The allocated pool entry to free \r
+\r
+ @retval EFI_INVALID_PARAMETER Buffer not valid \r
+ @retval EFI_SUCCESS Buffer successfully freed.\r
+\r
+**/\r
+EFI_STATUS\r
+CoreFreePoolI (\r
+ IN VOID *Buffer\r
+ )\r
+;\r
+\r
+\r
+\r
+/**\r
+ Enter critical section by gaining lock on gMemoryLock.\r
+\r
+**/\r
+VOID\r
+CoreAcquireMemoryLock (\r
+ VOID\r
+ )\r
+;\r
+\r
+\r
+/**\r
+ Exit critical section by releasing lock on gMemoryLock.\r
+\r
+**/\r
+VOID\r
+CoreReleaseMemoryLock (\r
+ VOID\r
+ )\r
+;\r
+\r
+\r
+//\r
+// Internal Global data\r
+//\r
+\r
+extern EFI_LOCK gMemoryLock; \r
+extern LIST_ENTRY gMemoryMap;\r
+extern MEMORY_MAP *gMemoryLastConvert;\r
+extern LIST_ENTRY mGcdMemorySpaceMap;\r
+#endif\r
+++ /dev/null
-/** @file \r
- \r
- Data structure and functions to allocate and free memory space.\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation \r
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-\r
-**/\r
-\r
-#ifndef _IMEM_H_\r
-#define _IMEM_H_\r
-\r
-#if defined (MDE_CPU_IPF)\r
-//\r
-// For Itanium machines make the default allocations 8K aligned\r
-//\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE * 2)\r
-#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE * 2)\r
-\r
-#else\r
-//\r
-// For genric EFI machines make the default allocations 4K aligned\r
-//\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)\r
-#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE)\r
-\r
-#endif\r
-\r
-\r
-//\r
-// MEMORY_MAP_ENTRY\r
-//\r
-\r
-#define MEMORY_MAP_SIGNATURE EFI_SIGNATURE_32('m','m','a','p')\r
-typedef struct {\r
- UINTN Signature;\r
- LIST_ENTRY Link;\r
- BOOLEAN FromPages;\r
-\r
- EFI_MEMORY_TYPE Type;\r
- UINT64 Start;\r
- UINT64 End;\r
-\r
- UINT64 VirtualStart;\r
- UINT64 Attribute;\r
-} MEMORY_MAP;\r
-\r
-//\r
-// Internal prototypes\r
-//\r
-\r
-\r
-/**\r
- Internal function. Used by the pool functions to allocate pages\r
- to back pool allocation requests.\r
-\r
- @param PoolType The type of memory for the new pool pages \r
- @param NumberOfPages No of pages to allocate \r
- @param Alignment Bits to align. \r
-\r
- @return The allocated memory, or NULL\r
-\r
-**/\r
-VOID *\r
-CoreAllocatePoolPages (\r
- IN EFI_MEMORY_TYPE PoolType,\r
- IN UINTN NumberOfPages,\r
- IN UINTN Alignment\r
- )\r
-;\r
-\r
-\r
-\r
-/**\r
- Internal function. Frees pool pages allocated via AllocatePoolPages ()\r
-\r
- @param Memory The base address to free \r
- @param NumberOfPages The number of pages to free\r
-\r
-**/\r
-VOID\r
-CoreFreePoolPages (\r
- IN EFI_PHYSICAL_ADDRESS Memory,\r
- IN UINTN NumberOfPages\r
- )\r
-;\r
-\r
-\r
-\r
-/**\r
- Internal function to allocate pool of a particular type.\r
- Caller must have the memory lock held\r
-\r
- @param PoolType Type of pool to allocate \r
- @param Size The amount of pool to allocate \r
-\r
- @return The allocate pool, or NULL\r
-\r
-**/\r
-VOID *\r
-CoreAllocatePoolI (\r
- IN EFI_MEMORY_TYPE PoolType,\r
- IN UINTN Size\r
- )\r
-;\r
-\r
-\r
-\r
-/**\r
- Internal function to free a pool entry.\r
- Caller must have the memory lock held\r
-\r
- @param Buffer The allocated pool entry to free \r
-\r
- @retval EFI_INVALID_PARAMETER Buffer not valid \r
- @retval EFI_SUCCESS Buffer successfully freed.\r
-\r
-**/\r
-EFI_STATUS\r
-CoreFreePoolI (\r
- IN VOID *Buffer\r
- )\r
-;\r
-\r
-\r
-\r
-/**\r
- Enter critical section by gaining lock on gMemoryLock.\r
-\r
-**/\r
-VOID\r
-CoreAcquireMemoryLock (\r
- VOID\r
- )\r
-;\r
-\r
-\r
-/**\r
- Exit critical section by releasing lock on gMemoryLock.\r
-\r
-**/\r
-VOID\r
-CoreReleaseMemoryLock (\r
- VOID\r
- )\r
-;\r
-\r
-\r
-//\r
-// Internal Global data\r
-//\r
-\r
-extern EFI_LOCK gMemoryLock; \r
-extern LIST_ENTRY gMemoryMap;\r
-extern MEMORY_MAP *gMemoryLastConvert;\r
-extern LIST_ENTRY mGcdMemorySpaceMap;\r
-#endif\r