]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.c
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Library / EmuVariableFvbLib / EmuVariableFvbLib.c
1 /** @file
2 OVMF platform customization for EMU Variable FVB driver
3
4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "PiDxe.h"
10 #include <Library/DebugLib.h>
11 #include <Library/PcdLib.h>
12 #include <Library/PlatformFvbLib.h>
13 #include <Library/UefiBootServicesTableLib.h>
14 #include <Library/UefiRuntimeLib.h>
15
16 /**
17 This function will be called following a call to the
18 EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Read function.
19
20 @param[in] This The EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
21 @param[in] Lba The starting logical block index
22 from which to read.
23 @param[in] Offset Offset into the block at which to begin reading.
24 @param[in] NumBytes The number of bytes read.
25 @param[in] Buffer Pointer to the buffer that was read, and will be
26 returned to the caller.
27
28 **/
29 VOID
30 EFIAPI
31 PlatformFvbDataRead (
32 IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
33 IN EFI_LBA Lba,
34 IN UINTN Offset,
35 IN UINTN NumBytes,
36 IN UINT8 *Buffer
37 )
38 {
39 }
40
41 /**
42 This function will be called following a call to the
43 EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Write function.
44
45 @param[in] This EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
46 @param[in] Lba The starting logical block index to written to.
47 @param[in] Offset Offset into the block at which to begin writing.
48 @param[in] NumBytes The number of bytes written.
49 @param[in] Buffer Pointer to the buffer that was written.
50
51 **/
52 VOID
53 EFIAPI
54 PlatformFvbDataWritten (
55 IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
56 IN EFI_LBA Lba,
57 IN UINTN Offset,
58 IN UINTN NumBytes,
59 IN UINT8 *Buffer
60 )
61 {
62 STATIC EFI_EVENT EventToSignal = NULL;
63
64 if (!EfiAtRuntime ()) {
65 if (EventToSignal == NULL) {
66 EventToSignal = (EFI_EVENT)(UINTN)PcdGet64 (PcdEmuVariableEvent);
67 }
68
69 if (EventToSignal != NULL) {
70 gBS->SignalEvent (EventToSignal);
71 }
72 }
73 }
74
75 /**
76 This function will be called following a call to the
77 EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase function.
78
79 @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL
80 instance.
81 @param List The variable argument list as documented for
82 the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase
83 function.
84
85 **/
86 VOID
87 EFIAPI
88 PlatformFvbBlocksErased (
89 IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
90 IN VA_LIST List
91 )
92 {
93 }