]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: add DXE_SMM_DRIVER build
[mirror_edk2.git] / OvmfPkg / QemuFlashFvbServicesRuntimeDxe / FwBlockServiceSmm.c
1 /**@file
2 Functions related to the Firmware Volume Block service whose
3 implementation is specific to the SMM driver build.
4
5 Copyright (C) 2015, Red Hat, Inc.
6 Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
7
8 This program and the accompanying materials are licensed and made available
9 under the terms and conditions of the BSD License which accompanies this
10 distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 **/
16
17 #include <Library/DebugLib.h>
18 #include <Library/SmmServicesTableLib.h>
19 #include <Protocol/DevicePath.h>
20 #include <Protocol/SmmFirmwareVolumeBlock.h>
21
22 #include "FwBlockService.h"
23
24 VOID
25 InstallProtocolInterfaces (
26 IN EFI_FW_VOL_BLOCK_DEVICE *FvbDevice
27 )
28 {
29 EFI_HANDLE FvbHandle;
30 EFI_STATUS Status;
31
32 //
33 // There is no SMM service that can install multiple protocols in the SMM
34 // protocol database in one go.
35 //
36 // The SMM Firmware Volume Block protocol structure is the same as the
37 // Firmware Volume Block protocol structure.
38 //
39 FvbHandle = NULL;
40 DEBUG ((EFI_D_INFO, "Installing QEMU flash SMM FVB\n"));
41 Status = gSmst->SmmInstallProtocolInterface (
42 &FvbHandle,
43 &gEfiSmmFirmwareVolumeBlockProtocolGuid,
44 EFI_NATIVE_INTERFACE,
45 &FvbDevice->FwVolBlockInstance
46 );
47 ASSERT_EFI_ERROR (Status);
48
49 Status = gSmst->SmmInstallProtocolInterface (
50 &FvbHandle,
51 &gEfiDevicePathProtocolGuid,
52 EFI_NATIVE_INTERFACE,
53 FvbDevice->DevicePath
54 );
55 ASSERT_EFI_ERROR (Status);
56 }
57
58 VOID
59 InstallVirtualAddressChangeHandler (
60 VOID
61 )
62 {
63 //
64 // Nothing.
65 //
66 }