VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/SmmAccess/SmramInternal.h

Last change on this file was 105670, checked in by vboxsync, 9 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1/** @file
2
3 Functions and types shared by the SMM accessor PEI and DXE modules.
4
5 Copyright (C) 2015, Red Hat, Inc.
6 Copyright (c) 2024 Intel Corporation.
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#include <Pi/PiMultiPhase.h>
13
14#include <Guid/SmramMemoryReserve.h>
15#include <Library/HobLib.h>
16
17//
18// The value of PcdQ35TsegMbytes is saved into this variable at module startup.
19//
20extern UINT16 mQ35TsegMbytes;
21
22/**
23 Save PcdQ35TsegMbytes into mQ35TsegMbytes.
24**/
25VOID
26InitQ35TsegMbytes (
27 VOID
28 );
29
30/**
31 Save PcdQ35SmramAtDefaultSmbase into mQ35SmramAtDefaultSmbase.
32**/
33VOID
34InitQ35SmramAtDefaultSmbase (
35 VOID
36 );
37
38/**
39 Read the MCH_SMRAM and ESMRAMC registers, and update the LockState and
40 OpenState fields in the PEI_SMM_ACCESS_PPI / EFI_SMM_ACCESS2_PROTOCOL object,
41 from the D_LCK and T_EN bits.
42
43 PEI_SMM_ACCESS_PPI and EFI_SMM_ACCESS2_PROTOCOL member functions can rely on
44 the LockState and OpenState fields being up-to-date on entry, and they need
45 to restore the same invariant on exit, if they touch the bits in question.
46
47 @param[out] LockState Reflects the D_LCK bit on output; TRUE iff SMRAM is
48 locked.
49 @param[out] OpenState Reflects the inverse of the T_EN bit on output; TRUE
50 iff SMRAM is open.
51**/
52VOID
53GetStates (
54 OUT BOOLEAN *LockState,
55 OUT BOOLEAN *OpenState
56 );
57
58//
59// The functions below follow the PEI_SMM_ACCESS_PPI and
60// EFI_SMM_ACCESS2_PROTOCOL member declarations. The PeiServices and This
61// pointers are removed (TSEG doesn't depend on them), and so is the
62// DescriptorIndex parameter (TSEG doesn't support range-wise locking).
63//
64// The LockState and OpenState members that are common to both
65// PEI_SMM_ACCESS_PPI and EFI_SMM_ACCESS2_PROTOCOL are taken and updated in
66// isolation from the rest of the (non-shared) members.
67//
68
69EFI_STATUS
70SmramAccessOpen (
71 OUT BOOLEAN *LockState,
72 OUT BOOLEAN *OpenState
73 );
74
75EFI_STATUS
76SmramAccessClose (
77 OUT BOOLEAN *LockState,
78 OUT BOOLEAN *OpenState
79 );
80
81EFI_STATUS
82SmramAccessLock (
83 OUT BOOLEAN *LockState,
84 IN OUT BOOLEAN *OpenState
85 );
86
87EFI_STATUS
88SmramAccessGetCapabilities (
89 IN OUT UINTN *SmramMapSize,
90 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
91 );
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette