]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.c
OVMF: Add library to customize the EMU Variable FVB driver.
[mirror_edk2.git] / OvmfPkg / Library / EmuVariableFvbLib / EmuVariableFvbLib.c
1 /** @file
2 OVMF platform customization for EMU Variable FVB driver
3
4 Copyright (c) 2009, Intel Corporation
5 All rights reserved. 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 "PiDxe.h"
16 #include <Library/DebugLib.h>
17 #include <Library/PcdLib.h>
18 #include <Library/PlatformFvbLib.h>
19 #include <Library/UefiBootServicesTableLib.h>
20 #include <Library/UefiRuntimeLib.h>
21
22
23 /**
24 This function will be called following a call to the
25 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL Write function.
26
27 @param[in] This EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL instance.
28 @param[in] Lba The starting logical block index to written to.
29
30 **/
31 VOID
32 EFIAPI
33 PlatformFvbDataWritten (
34 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
35 IN EFI_LBA Lba
36 )
37 {
38 STATIC EFI_EVENT EventToSignal = NULL;
39
40 if (!EfiAtRuntime ()) {
41 if (EventToSignal == NULL) {
42 EventToSignal = (EFI_EVENT)(UINTN) PcdGet64 (PcdEmuVariableEvent);
43 }
44 if (EventToSignal != NULL) {
45 gBS->SignalEvent (EventToSignal);
46 }
47 }
48 }
49
50