]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecTempRamDone.c
Add IntelFsp2Pkg and IntelFsp2WrapperPkg.
[mirror_edk2.git] / IntelFsp2WrapperPkg / Library / SecFspWrapperPlatformSecLibSample / SecTempRamDone.c
1 /** @file
2 Sample to provide SecTemporaryRamDone function.
3
4 Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include <PiPei.h>
16
17 #include <Ppi/TemporaryRamDone.h>
18
19 #include <Library/BaseMemoryLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/PcdLib.h>
22 #include <Library/DebugAgentLib.h>
23 #include <Library/FspPlatformInfoLib.h>
24 #include <Library/FspApiLib.h>
25
26 /**
27 This interface disables temporary memory in SEC Phase.
28 **/
29 VOID
30 EFIAPI
31 SecPlatformDisableTemporaryMemory (
32 VOID
33 )
34 {
35 EFI_STATUS Status;
36 VOID *TempRamExitParam;
37 FSP_INFO_HEADER *FspHeader;
38
39 FspHeader = FspFindFspHeader (PcdGet32(PcdFspmBaseAddress));
40 if (FspHeader == NULL) {
41 return ;
42 }
43
44 DEBUG((DEBUG_INFO, "SecPlatformDisableTemporaryMemory enter\n"));
45
46 TempRamExitParam = GetTempRamExitParam ();
47 Status = CallTempRamExit (FspHeader, TempRamExitParam);
48 DEBUG((DEBUG_INFO, "TempRamExit status: 0x%x\n", Status));
49 ASSERT_EFI_ERROR(Status);
50
51 return ;
52 }