]> git.proxmox.com Git - mirror_edk2.git/blob - StandaloneMmPkg/Core/StandaloneMmCorePrivateData.h
StandaloneMmPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / StandaloneMmPkg / Core / StandaloneMmCorePrivateData.h
1 /** @file
2 The internal header file that declared a data structure that is shared
3 between the MM IPL and the MM Core.
4
5 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef _STANDALONE_MM_CORE_PRIVATE_DATA_H_
12 #define _STANDALONE_MM_CORE_PRIVATE_DATA_H_
13
14 #include <Guid/MmCoreData.h>
15
16 //
17 // Page management
18 //
19
20 typedef struct {
21 LIST_ENTRY Link;
22 UINTN NumberOfPages;
23 } FREE_PAGE_LIST;
24
25 extern LIST_ENTRY mMmMemoryMap;
26
27 //
28 // Pool management
29 //
30
31 //
32 // MIN_POOL_SHIFT must not be less than 5
33 //
34 #define MIN_POOL_SHIFT 6
35 #define MIN_POOL_SIZE (1 << MIN_POOL_SHIFT)
36
37 //
38 // MAX_POOL_SHIFT must not be less than EFI_PAGE_SHIFT - 1
39 //
40 #define MAX_POOL_SHIFT (EFI_PAGE_SHIFT - 1)
41 #define MAX_POOL_SIZE (1 << MAX_POOL_SHIFT)
42
43 //
44 // MAX_POOL_INDEX are calculated by maximum and minimum pool sizes
45 //
46 #define MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1)
47
48 typedef struct {
49 UINTN Size;
50 BOOLEAN Available;
51 } POOL_HEADER;
52
53 typedef struct {
54 POOL_HEADER Header;
55 LIST_ENTRY Link;
56 } FREE_POOL_HEADER;
57
58 extern LIST_ENTRY mMmPoolLists[MAX_POOL_INDEX];
59
60 #endif