]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | HOB Library implementation for Standalone MM Core.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r | |
5 | Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.<BR>\r | |
6 | \r | |
7 | This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php.\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #include <PiMm.h>\r | |
18 | \r | |
19 | #include <Library/HobLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | #include <Library/BaseMemoryLib.h>\r | |
22 | \r | |
23 | #include <Guid/MemoryAllocationHob.h>\r | |
24 | \r | |
25 | //\r | |
26 | // Cache copy of HobList pointer.\r | |
27 | //\r | |
28 | extern VOID *gHobList;\r | |
29 | \r | |
30 | EFI_HOB_HANDOFF_INFO_TABLE*\r | |
31 | HobConstructor (\r | |
32 | IN VOID *EfiMemoryBegin,\r | |
33 | IN UINTN EfiMemoryLength,\r | |
34 | IN VOID *EfiFreeMemoryBottom,\r | |
35 | IN VOID *EfiFreeMemoryTop\r | |
36 | )\r | |
37 | {\r | |
38 | EFI_HOB_HANDOFF_INFO_TABLE *Hob;\r | |
39 | EFI_HOB_GENERIC_HEADER *HobEnd;\r | |
40 | \r | |
41 | Hob = EfiFreeMemoryBottom;\r | |
42 | HobEnd = (EFI_HOB_GENERIC_HEADER *)(Hob+1);\r | |
43 | \r | |
44 | Hob->Header.HobType = EFI_HOB_TYPE_HANDOFF;\r | |
45 | Hob->Header.HobLength = sizeof (EFI_HOB_HANDOFF_INFO_TABLE);\r | |
46 | Hob->Header.Reserved = 0;\r | |
47 | \r | |
48 | HobEnd->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST;\r | |
49 | HobEnd->HobLength = sizeof (EFI_HOB_GENERIC_HEADER);\r | |
50 | HobEnd->Reserved = 0;\r | |
51 | \r | |
52 | Hob->Version = EFI_HOB_HANDOFF_TABLE_VERSION;\r | |
53 | Hob->BootMode = BOOT_WITH_FULL_CONFIGURATION;\r | |
54 | \r | |
55 | Hob->EfiMemoryTop = (UINTN)EfiMemoryBegin + EfiMemoryLength;\r | |
56 | Hob->EfiMemoryBottom = (UINTN)EfiMemoryBegin;\r | |
57 | Hob->EfiFreeMemoryTop = (UINTN)EfiFreeMemoryTop;\r | |
58 | Hob->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS)(UINTN)(HobEnd+1);\r | |
59 | Hob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS)(UINTN)HobEnd;\r | |
60 | \r | |
61 | gHobList = Hob;\r | |
62 | \r | |
63 | return Hob;\r | |
64 | }\r |