]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeCache.h
f9804a1d692d950a97b3b819deab684ee4a4803c
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / VariableRuntimeCache.h
1 /** @file
2 The common variable volatile store routines shared by the DXE_RUNTIME variable
3 module and the DXE_SMM variable module.
4
5 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _VARIABLE_RUNTIME_CACHE_H_
11 #define _VARIABLE_RUNTIME_CACHE_H_
12
13 #include "Variable.h"
14
15 /**
16 Copies any pending updates to runtime variable caches.
17
18 @retval EFI_UNSUPPORTED The volatile store to be updated is not initialized properly.
19 @retval EFI_SUCCESS The volatile store was updated successfully.
20
21 **/
22 EFI_STATUS
23 FlushPendingRuntimeVariableCacheUpdates (
24 VOID
25 );
26
27 /**
28 Synchronizes the runtime variable caches with all pending updates outside runtime.
29
30 Ensures all conditions are met to maintain coherency for runtime cache updates. This function will attempt
31 to write the given update (and any other pending updates) if the ReadLock is available. Otherwise, the
32 update is added as a pending update for the given variable store and it will be flushed to the runtime cache
33 at the next opportunity the ReadLock is available.
34
35 @param[in] VariableRuntimeCache Variable runtime cache structure for the runtime cache being synchronized.
36 @param[in] Offset Offset in bytes to apply the update.
37 @param[in] Length Length of data in bytes of the update.
38
39 @retval EFI_SUCCESS The update was added as a pending update successfully. If the variable runtime
40 cache ReadLock was available, the runtime cache was updated successfully.
41 @retval EFI_UNSUPPORTED The volatile store to be updated is not initialized properly.
42
43 **/
44 EFI_STATUS
45 SynchronizeRuntimeVariableCache (
46 IN VARIABLE_RUNTIME_CACHE *VariableRuntimeCache,
47 IN UINTN Offset,
48 IN UINTN Length
49 );
50
51 #endif