]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | EFI SMM Access2 Protocol as defined in the PI 1.2 specification.\r | |
3 | \r | |
4 | This protocol is used to control the visibility of the SMRAM on the platform.\r | |
5 | It abstracts the location and characteristics of SMRAM. The expectation is\r | |
6 | that the north bridge or memory controller would publish this protocol.\r | |
7 | \r | |
8 | The principal functionality found in the memory controller includes the following: \r | |
9 | - Exposing the SMRAM to all non-SMM agents, or the "open" state\r | |
10 | - Shrouding the SMRAM to all but the SMM agents, or the "closed" state\r | |
11 | - Preserving the system integrity, or "locking" the SMRAM, such that the settings cannot be \r | |
12 | perturbed by either boot service or runtime agents \r | |
13 | \r | |
14 | Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
15 | This program and the accompanying materials \r | |
16 | are licensed and made available under the terms and conditions of the BSD License \r | |
17 | which accompanies this distribution. The full text of the license may be found at \r | |
18 | http://opensource.org/licenses/bsd-license.php \r | |
19 | \r | |
20 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
21 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
22 | \r | |
23 | **/\r | |
24 | \r | |
25 | #ifndef _SMM_ACCESS2_H_\r | |
26 | #define _SMM_ACCESS2_H_\r | |
27 | \r | |
28 | #define EFI_SMM_ACCESS2_PROTOCOL_GUID \\r | |
29 | { \\r | |
30 | 0xc2702b74, 0x800c, 0x4131, {0x87, 0x46, 0x8f, 0xb5, 0xb8, 0x9c, 0xe4, 0xac } \\r | |
31 | }\r | |
32 | \r | |
33 | \r | |
34 | typedef struct _EFI_SMM_ACCESS2_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL;\r | |
35 | \r | |
36 | /**\r | |
37 | Opens the SMRAM area to be accessible by a boot-service driver.\r | |
38 | \r | |
39 | This function "opens" SMRAM so that it is visible while not inside of SMM. The function should \r | |
40 | return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM. The function \r | |
41 | should return EFI_DEVICE_ERROR if the SMRAM configuration is locked.\r | |
42 | \r | |
43 | @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.\r | |
44 | \r | |
45 | @retval EFI_SUCCESS The operation was successful.\r | |
46 | @retval EFI_UNSUPPORTED The system does not support opening and closing of SMRAM.\r | |
47 | @retval EFI_DEVICE_ERROR SMRAM cannot be opened, perhaps because it is locked.\r | |
48 | **/\r | |
49 | typedef\r | |
50 | EFI_STATUS\r | |
51 | (EFIAPI *EFI_SMM_OPEN2)(\r | |
52 | IN EFI_SMM_ACCESS2_PROTOCOL *This\r | |
53 | );\r | |
54 | \r | |
55 | /**\r | |
56 | Inhibits access to the SMRAM.\r | |
57 | \r | |
58 | This function "closes" SMRAM so that it is not visible while outside of SMM. The function should \r | |
59 | return EFI_UNSUPPORTED if the hardware does not support hiding of SMRAM.\r | |
60 | \r | |
61 | @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.\r | |
62 | \r | |
63 | @retval EFI_SUCCESS The operation was successful.\r | |
64 | @retval EFI_UNSUPPORTED The system does not support opening and closing of SMRAM.\r | |
65 | @retval EFI_DEVICE_ERROR SMRAM cannot be closed.\r | |
66 | **/\r | |
67 | typedef\r | |
68 | EFI_STATUS\r | |
69 | (EFIAPI *EFI_SMM_CLOSE2)(\r | |
70 | IN EFI_SMM_ACCESS2_PROTOCOL *This\r | |
71 | );\r | |
72 | \r | |
73 | /**\r | |
74 | Inhibits access to the SMRAM.\r | |
75 | \r | |
76 | This function prohibits access to the SMRAM region. This function is usually implemented such \r | |
77 | that it is a write-once operation. \r | |
78 | \r | |
79 | @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.\r | |
80 | \r | |
81 | @retval EFI_SUCCESS The device was successfully locked.\r | |
82 | @retval EFI_UNSUPPORTED The system does not support locking of SMRAM.\r | |
83 | **/\r | |
84 | typedef\r | |
85 | EFI_STATUS\r | |
86 | (EFIAPI *EFI_SMM_LOCK2)(\r | |
87 | IN EFI_SMM_ACCESS2_PROTOCOL *This\r | |
88 | );\r | |
89 | \r | |
90 | /**\r | |
91 | Queries the memory controller for the possible regions that will support SMRAM.\r | |
92 | \r | |
93 | @param[in] This The EFI_SMM_ACCESS2_PROTOCOL instance.\r | |
94 | @param[in,out] SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r | |
95 | @param[in,out] SmramMap A pointer to the buffer in which firmware places the current memory map.\r | |
96 | \r | |
97 | @retval EFI_SUCCESS The chipset supported the given resource.\r | |
98 | @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small. The current buffer size \r | |
99 | needed to hold the memory map is returned in SmramMapSize.\r | |
100 | **/\r | |
101 | typedef\r | |
102 | EFI_STATUS\r | |
103 | (EFIAPI *EFI_SMM_CAPABILITIES2)(\r | |
104 | IN CONST EFI_SMM_ACCESS2_PROTOCOL *This,\r | |
105 | IN OUT UINTN *SmramMapSize,\r | |
106 | IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r | |
107 | );\r | |
108 | \r | |
109 | ///\r | |
110 | /// EFI SMM Access2 Protocol is used to control the visibility of the SMRAM on the platform.\r | |
111 | /// It abstracts the location and characteristics of SMRAM. The platform should report all \r | |
112 | /// MMRAM via EFI_MM_ACCESS_PROTOCOL. The expectation is that the north bridge or memory \r | |
113 | /// controller would publish this protocol.\r | |
114 | /// \r | |
115 | struct _EFI_SMM_ACCESS2_PROTOCOL {\r | |
116 | EFI_SMM_OPEN2 Open;\r | |
117 | EFI_SMM_CLOSE2 Close;\r | |
118 | EFI_SMM_LOCK2 Lock;\r | |
119 | EFI_SMM_CAPABILITIES2 GetCapabilities;\r | |
120 | ///\r | |
121 | /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is locked.\r | |
122 | ///\r | |
123 | BOOLEAN LockState;\r | |
124 | ///\r | |
125 | /// Indicates the current state of the SMRAM. Set to TRUE if SMRAM is open.\r | |
126 | ///\r | |
127 | BOOLEAN OpenState;\r | |
128 | };\r | |
129 | \r | |
130 | extern EFI_GUID gEfiSmmAccess2ProtocolGuid;\r | |
131 | \r | |
132 | #endif\r | |
133 | \r |