]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c
OvmfPkg: set fixed FlashNvStorage base addresses with -D SMM_REQUIRE
[mirror_edk2.git] / OvmfPkg / QemuFlashFvbServicesRuntimeDxe / FwBlockServiceSmm.c
CommitLineData
79397dbd
LE
1/**@file\r
2 Functions related to the Firmware Volume Block service whose\r
3 implementation is specific to the SMM driver build.\r
4\r
5 Copyright (C) 2015, Red Hat, Inc.\r
6 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
7\r
b26f0cf9 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
79397dbd
LE
9**/\r
10\r
11#include <Library/DebugLib.h>\r
b963ec49 12#include <Library/PcdLib.h>\r
79397dbd
LE
13#include <Library/SmmServicesTableLib.h>\r
14#include <Protocol/DevicePath.h>\r
15#include <Protocol/SmmFirmwareVolumeBlock.h>\r
16\r
17#include "FwBlockService.h"\r
18\r
19VOID\r
20InstallProtocolInterfaces (\r
21 IN EFI_FW_VOL_BLOCK_DEVICE *FvbDevice\r
22 )\r
23{\r
24 EFI_HANDLE FvbHandle;\r
25 EFI_STATUS Status;\r
26\r
b963ec49
LE
27 ASSERT (FeaturePcdGet (PcdSmmSmramRequire));\r
28\r
79397dbd
LE
29 //\r
30 // There is no SMM service that can install multiple protocols in the SMM\r
31 // protocol database in one go.\r
32 //\r
33 // The SMM Firmware Volume Block protocol structure is the same as the\r
34 // Firmware Volume Block protocol structure.\r
35 //\r
36 FvbHandle = NULL;\r
37 DEBUG ((EFI_D_INFO, "Installing QEMU flash SMM FVB\n"));\r
38 Status = gSmst->SmmInstallProtocolInterface (\r
39 &FvbHandle,\r
40 &gEfiSmmFirmwareVolumeBlockProtocolGuid,\r
41 EFI_NATIVE_INTERFACE,\r
42 &FvbDevice->FwVolBlockInstance\r
43 );\r
44 ASSERT_EFI_ERROR (Status);\r
45\r
46 Status = gSmst->SmmInstallProtocolInterface (\r
47 &FvbHandle,\r
48 &gEfiDevicePathProtocolGuid,\r
49 EFI_NATIVE_INTERFACE,\r
50 FvbDevice->DevicePath\r
51 );\r
52 ASSERT_EFI_ERROR (Status);\r
53}\r
54\r
55VOID\r
56InstallVirtualAddressChangeHandler (\r
57 VOID\r
58 )\r
59{\r
60 //\r
61 // Nothing.\r
62 //\r
63}\r
3b3d016b
BS
64\r
65EFI_STATUS\r
66MarkIoMemoryRangeForRuntimeAccess (\r
67 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
68 IN UINTN Length\r
69 )\r
70{\r
71 //\r
72 // Nothing\r
73 //\r
74\r
75 return EFI_SUCCESS;\r
76}\r
cd99d07d
LE
77\r
78VOID\r
79SetPcdFlashNvStorageBaseAddresses (\r
80 VOID\r
81 )\r
82{\r
cd99d07d 83 //\r
b0ed7ebd 84 // Do nothing.\r
cd99d07d 85 //\r
cd99d07d 86}\r