[edk2] [PATCH v2 2/4] MdeModulePkg/PageTablePool.h: Page table pool GUID definition file

Jian J Wang posted 4 patches 7 years ago
There is a newer version of this series
[edk2] [PATCH v2 2/4] MdeModulePkg/PageTablePool.h: Page table pool GUID definition file
Posted by Jian J Wang 7 years ago
> v2:
>    newly added

This file is added to definition of gPageTablePoolGuid. In addition,
following structure type is defined to describe the page table pool
information which can be used by different drivers to allocate memory
for new page tables. It's supposed to be at the start address of each
separated pool. The NextPool field is used to link all the pools
together which helps to track and manage all the page tables easily.

typedef struct {
  EFI_GUID              Signature;
  EFI_PHYSICAL_ADDRESS  NextPool;
  UINT64                Offset;
  UINT64                FreePages;
} PAGE_TABLE_POOL_HEADER;

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
---
 MdeModulePkg/Include/Guid/PageTablePool.h | 53 +++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 MdeModulePkg/Include/Guid/PageTablePool.h

diff --git a/MdeModulePkg/Include/Guid/PageTablePool.h b/MdeModulePkg/Include/Guid/PageTablePool.h
new file mode 100644
index 0000000000..103739a9db
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/PageTablePool.h
@@ -0,0 +1,53 @@
+/** @file
+  GUID used to identify the memory pool used for page table.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PAGE_TABLE_POOL_H__
+#define __PAGE_TABLE_POOL_H__
+
+///
+/// GUID value used to identify page table pool.
+///
+/// [18347A49-F48B-4012-671D-7023765C92AD]
+///
+#define PAGE_TABLE_POOL_GUID \
+  { \
+    0x18347A49, 0xF48B, 0x4012, {0x67, 0x1D, 0x70, 0x23, 0x76, 0x5C, 0x92, 0xAD} \
+  }
+
+///
+/// A structure at the header of first page in each page table pool.
+///
+typedef struct {
+  ///
+  /// Signature used to identify the memory pool used for page table.
+  ///
+  EFI_GUID              Signature;
+  ///
+  /// The address pointing to the header of next page table pool.
+  ///
+  EFI_PHYSICAL_ADDRESS  NextPool;
+  ///
+  /// The offset (in bytes) of free pages in current pool.
+  ///
+  UINT64                Offset;
+  ///
+  /// The number of free pages.
+  ///
+  UINT64                FreePages;
+} PAGE_TABLE_POOL_HEADER;
+
+extern EFI_GUID gPageTablePoolGuid;
+
+#endif  //__PAGE_TABLE_POOL_H__
-- 
2.14.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel