]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.c
Add 4 APIs to DevicePathLib: ConvertDeviceNodeToText, ConvertDevicePathToText, Conver...
[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 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_BLOCK2_PROTOCOL Read function.
26
27 @param[in] This The EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
28 @param[in] Lba The starting logical block index
29 from which to read.
30 @param[in] Offset Offset into the block at which to begin reading.
31 @param[in] NumBytes The number of bytes read.
32 @param[in] Buffer Pointer to the buffer that was read, and will be
33 returned to the caller.
34
35 **/
36 VOID
37 EFIAPI
38 PlatformFvbDataRead (
39 IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
40 IN EFI_LBA Lba,
41 IN UINTN Offset,
42 IN UINTN NumBytes,
43 IN UINT8 *Buffer
44 )
45 {
46 }
47
48
49 /**
50 This function will be called following a call to the
51 EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Write function.
52
53 @param[in] This EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
54 @param[in] Lba The starting logical block index to written to.
55 @param[in] Offset Offset into the block at which to begin writing.
56 @param[in] NumBytes The number of bytes written.
57 @param[in] Buffer Pointer to the buffer that was written.
58
59 **/
60 VOID
61 EFIAPI
62 PlatformFvbDataWritten (
63 IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
64 IN EFI_LBA Lba,
65 IN UINTN Offset,
66 IN UINTN NumBytes,
67 IN UINT8 *Buffer
68 )
69 {
70 STATIC EFI_EVENT EventToSignal = NULL;
71
72 if (!EfiAtRuntime ()) {
73 if (EventToSignal == NULL) {
74 EventToSignal = (EFI_EVENT)(UINTN) PcdGet64 (PcdEmuVariableEvent);
75 }
76 if (EventToSignal != NULL) {
77 gBS->SignalEvent (EventToSignal);
78 }
79 }
80 }
81
82
83 /**
84 This function will be called following a call to the
85 EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase function.
86
87 @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL
88 instance.
89 @param List The variable argument list as documented for
90 the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL Erase
91 function.
92
93 **/
94 VOID
95 EFIAPI
96 PlatformFvbBlocksErased (
97 IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
98 IN VA_LIST List
99 )
100 {
101 }
102
103