]> git.proxmox.com Git - mirror_edk2.git/blame - StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c
StandaloneMmPkg: build for 32bit arm machines
[mirror_edk2.git] / StandaloneMmPkg / Library / StandaloneMmCoreHobLib / Arm / StandaloneMmCoreHobLibInternal.c
CommitLineData
70a51d71
SV
1/** @file\r
2 HOB Library implementation for Standalone MM Core.\r
3\r
4Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
5Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.<BR>\r
6\r
86094561 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
70a51d71
SV
8\r
9**/\r
10\r
11#include <PiMm.h>\r
12\r
13#include <Library/HobLib.h>\r
14#include <Library/DebugLib.h>\r
15#include <Library/BaseMemoryLib.h>\r
16\r
17#include <Guid/MemoryAllocationHob.h>\r
18\r
19//\r
20// Cache copy of HobList pointer.\r
21//\r
22extern VOID *gHobList;\r
23\r
24EFI_HOB_HANDOFF_INFO_TABLE*\r
25HobConstructor (\r
26 IN VOID *EfiMemoryBegin,\r
27 IN UINTN EfiMemoryLength,\r
28 IN VOID *EfiFreeMemoryBottom,\r
29 IN VOID *EfiFreeMemoryTop\r
30 )\r
31{\r
32 EFI_HOB_HANDOFF_INFO_TABLE *Hob;\r
33 EFI_HOB_GENERIC_HEADER *HobEnd;\r
34\r
35 Hob = EfiFreeMemoryBottom;\r
36 HobEnd = (EFI_HOB_GENERIC_HEADER *)(Hob+1);\r
37\r
38 Hob->Header.HobType = EFI_HOB_TYPE_HANDOFF;\r
39 Hob->Header.HobLength = sizeof (EFI_HOB_HANDOFF_INFO_TABLE);\r
40 Hob->Header.Reserved = 0;\r
41\r
42 HobEnd->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST;\r
43 HobEnd->HobLength = sizeof (EFI_HOB_GENERIC_HEADER);\r
44 HobEnd->Reserved = 0;\r
45\r
46 Hob->Version = EFI_HOB_HANDOFF_TABLE_VERSION;\r
47 Hob->BootMode = BOOT_WITH_FULL_CONFIGURATION;\r
48\r
49 Hob->EfiMemoryTop = (UINTN)EfiMemoryBegin + EfiMemoryLength;\r
50 Hob->EfiMemoryBottom = (UINTN)EfiMemoryBegin;\r
51 Hob->EfiFreeMemoryTop = (UINTN)EfiFreeMemoryTop;\r
52 Hob->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS)(UINTN)(HobEnd+1);\r
53 Hob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS)(UINTN)HobEnd;\r
54\r
55 gHobList = Hob;\r
56\r
57 return Hob;\r
58}\r