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