StandaloneMmPkg: Add CPU driver suitable for ARM Platforms.
[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 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _STANDALONE_MM_CORE_PRIVATE_DATA_H_
18 #define _STANDALONE_MM_CORE_PRIVATE_DATA_H_
19
20 #include <Guid/MmCoreData.h>
21
22 //
23 // Page management
24 //
25
26 typedef struct {
27 LIST_ENTRY Link;
28 UINTN NumberOfPages;
29 } FREE_PAGE_LIST;
30
31 extern LIST_ENTRY mMmMemoryMap;
32
33 //
34 // Pool management
35 //
36
37 //
38 // MIN_POOL_SHIFT must not be less than 5
39 //
40 #define MIN_POOL_SHIFT 6
41 #define MIN_POOL_SIZE (1 << MIN_POOL_SHIFT)
42
43 //
44 // MAX_POOL_SHIFT must not be less than EFI_PAGE_SHIFT - 1
45 //
46 #define MAX_POOL_SHIFT (EFI_PAGE_SHIFT - 1)
47 #define MAX_POOL_SIZE (1 << MAX_POOL_SHIFT)
48
49 //
50 // MAX_POOL_INDEX are calculated by maximum and minimum pool sizes
51 //
52 #define MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1)
53
54 typedef struct {
55 UINTN Size;
56 BOOLEAN Available;
57 } POOL_HEADER;
58
59 typedef struct {
60 POOL_HEADER Header;
61 LIST_ENTRY Link;
62 } FREE_POOL_HEADER;
63
64 extern LIST_ENTRY mMmPoolLists[MAX_POOL_INDEX];
65
66 #endif