]>
Commit | Line | Data |
---|---|---|
79964ac8 | 1 | /** @file\r |
1c2f052d | 2 | This file declares the SMM SMRAM Access abstraction protocol, which is used to control\r |
8411f1c0 | 3 | the visibility of the SMRAM on the platform. The expectation is\r |
1c2f052d LG |
4 | that the north bridge or memory controller would publish this protocol.\r |
5 | For example, the Memory Controller Hub (MCH) has the hardware provision for this\r | |
6 | type of control. Because of the protected, distinguished class of memory for IA-32\r | |
8411f1c0 | 7 | systems, the expectation is that this protocol would be supported only on IA-32 systems.\r |
79964ac8 | 8 | \r |
1c2f052d | 9 | Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r |
22a69a5e | 10 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
79964ac8 | 11 | \r |
79964ac8 | 12 | @par Revision Reference:\r |
13 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r | |
14 | Version 0.9.\r | |
15 | **/\r | |
16 | \r | |
17 | #ifndef _SMM_ACCESS_H_\r | |
18 | #define _SMM_ACCESS_H_\r | |
19 | \r | |
b80fbe85 | 20 | #include <Guid/SmramMemoryReserve.h>\r |
79964ac8 | 21 | \r |
22 | typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;\r | |
23 | \r | |
24 | #define EFI_SMM_ACCESS_PROTOCOL_GUID \\r | |
25 | { \\r | |
26 | 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r | |
27 | }\r | |
28 | \r | |
79964ac8 | 29 | //\r |
30 | // SMM Access specification Member Function\r | |
31 | //\r | |
32 | /**\r | |
33 | Opens the SMRAM area to be accessible by a boot-service driver.\r | |
34 | \r | |
35 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r | |
36 | @param DescriptorIndex Indicates that the driver wishes to open\r | |
37 | the memory tagged by this index.\r | |
38 | \r | |
39 | @retval EFI_SUCCESS The operation was successful.\r | |
40 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r | |
41 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r | |
42 | \r | |
43 | **/\r | |
44 | typedef\r | |
45 | EFI_STATUS\r | |
69686d56 | 46 | (EFIAPI *EFI_SMM_OPEN)(\r |
79964ac8 | 47 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
48 | UINTN DescriptorIndex\r | |
49 | );\r | |
50 | \r | |
51 | /**\r | |
52 | Inhibits access to the SMRAM.\r | |
53 | \r | |
54 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r | |
693c4e02 | 55 | @param DescriptorIndex Indicates that the driver wishes to close\r |
79964ac8 | 56 | the memory tagged by this index.\r |
57 | \r | |
58 | @retval EFI_SUCCESS The operation was successful.\r | |
59 | @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r | |
60 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r | |
61 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r | |
62 | \r | |
63 | **/\r | |
64 | typedef\r | |
65 | EFI_STATUS\r | |
69686d56 | 66 | (EFIAPI *EFI_SMM_CLOSE)(\r |
79964ac8 | 67 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
68 | UINTN DescriptorIndex\r | |
69 | );\r | |
70 | \r | |
71 | /**\r | |
72 | Inhibits access to the SMRAM.\r | |
693c4e02 | 73 | \r |
79964ac8 | 74 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r |
693c4e02 | 75 | @param DescriptorIndex Indicates that the driver wishes to lock\r |
79964ac8 | 76 | the memory tagged by this index.\r |
77 | \r | |
78 | @retval EFI_SUCCESS The operation was successful.\r | |
79 | @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r | |
80 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r | |
81 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r | |
82 | \r | |
83 | **/\r | |
84 | typedef\r | |
85 | EFI_STATUS\r | |
69686d56 | 86 | (EFIAPI *EFI_SMM_LOCK)(\r |
79964ac8 | 87 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
88 | UINTN DescriptorIndex\r | |
89 | );\r | |
90 | \r | |
91 | /**\r | |
92 | Queries the memory controller for the possible regions that will support SMRAM.\r | |
93 | \r | |
94 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r | |
95 | @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r | |
96 | @param SmramMap A pointer to the buffer in which firmware places the current memory map.\r | |
97 | \r | |
98 | @retval EFI_SUCCESS The chipset supported the given resource.\r | |
99 | @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r | |
100 | \r | |
101 | **/\r | |
102 | typedef\r | |
103 | EFI_STATUS\r | |
69686d56 | 104 | (EFIAPI *EFI_SMM_CAPABILITIES)(\r |
79964ac8 | 105 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
106 | IN OUT UINTN *SmramMapSize,\r | |
107 | IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r | |
108 | );\r | |
109 | \r | |
110 | /**\r | |
79964ac8 | 111 | This protocol is used to control the visibility of the SMRAM on the platform.\r |
79964ac8 | 112 | **/\r |
113 | struct _EFI_SMM_ACCESS_PROTOCOL {\r | |
2bbaeb0d | 114 | EFI_SMM_OPEN Open; ///< Opens the SMRAM.\r |
115 | EFI_SMM_CLOSE Close; ///< Closes the SMRAM.\r | |
116 | EFI_SMM_LOCK Lock; ///< Locks the SMRAM.\r | |
117 | EFI_SMM_CAPABILITIES GetCapabilities; ///< Gets information on possible SMRAM regions.\r | |
118 | BOOLEAN LockState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is locked.\r | |
119 | BOOLEAN OpenState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is open.\r | |
79964ac8 | 120 | };\r |
121 | \r | |
122 | extern EFI_GUID gEfiSmmAccessProtocolGuid;\r | |
123 | \r | |
124 | #endif\r |