]>
Commit | Line | Data |
---|---|---|
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 | |
8 | This program and the accompanying materials are licensed and made available\r | |
9 | under the terms and conditions of the BSD License which accompanies this\r | |
10 | distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | **/\r | |
16 | \r | |
17 | #include <Library/DebugLib.h>\r | |
b963ec49 | 18 | #include <Library/PcdLib.h>\r |
79397dbd LE |
19 | #include <Library/SmmServicesTableLib.h>\r |
20 | #include <Protocol/DevicePath.h>\r | |
21 | #include <Protocol/SmmFirmwareVolumeBlock.h>\r | |
22 | \r | |
23 | #include "FwBlockService.h"\r | |
24 | \r | |
25 | VOID\r | |
26 | InstallProtocolInterfaces (\r | |
27 | IN EFI_FW_VOL_BLOCK_DEVICE *FvbDevice\r | |
28 | )\r | |
29 | {\r | |
30 | EFI_HANDLE FvbHandle;\r | |
31 | EFI_STATUS Status;\r | |
32 | \r | |
b963ec49 LE |
33 | ASSERT (FeaturePcdGet (PcdSmmSmramRequire));\r |
34 | \r | |
79397dbd LE |
35 | //\r |
36 | // There is no SMM service that can install multiple protocols in the SMM\r | |
37 | // protocol database in one go.\r | |
38 | //\r | |
39 | // The SMM Firmware Volume Block protocol structure is the same as the\r | |
40 | // Firmware Volume Block protocol structure.\r | |
41 | //\r | |
42 | FvbHandle = NULL;\r | |
43 | DEBUG ((EFI_D_INFO, "Installing QEMU flash SMM FVB\n"));\r | |
44 | Status = gSmst->SmmInstallProtocolInterface (\r | |
45 | &FvbHandle,\r | |
46 | &gEfiSmmFirmwareVolumeBlockProtocolGuid,\r | |
47 | EFI_NATIVE_INTERFACE,\r | |
48 | &FvbDevice->FwVolBlockInstance\r | |
49 | );\r | |
50 | ASSERT_EFI_ERROR (Status);\r | |
51 | \r | |
52 | Status = gSmst->SmmInstallProtocolInterface (\r | |
53 | &FvbHandle,\r | |
54 | &gEfiDevicePathProtocolGuid,\r | |
55 | EFI_NATIVE_INTERFACE,\r | |
56 | FvbDevice->DevicePath\r | |
57 | );\r | |
58 | ASSERT_EFI_ERROR (Status);\r | |
59 | }\r | |
60 | \r | |
61 | VOID\r | |
62 | InstallVirtualAddressChangeHandler (\r | |
63 | VOID\r | |
64 | )\r | |
65 | {\r | |
66 | //\r | |
67 | // Nothing.\r | |
68 | //\r | |
69 | }\r |