]>
Commit | Line | Data |
---|---|---|
79964ac8 | 1 | /** @file\r |
5259c97d | 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 |
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 | |
7 | systems, the expectation is that this protocol would be supported only on IA-32 systems.\r | |
79964ac8 | 8 | \r |
2b3687db | 9 | Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r |
f22f941e | 10 | This program and the accompanying materials are licensed and made available under \r |
11 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
12 | The full text of the license may be found at\r | |
13 | http://opensource.org/licenses/bsd-license.php. \r | |
14 | \r | |
15 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
16 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
79964ac8 | 17 | \r |
79964ac8 | 18 | @par Revision Reference:\r |
19 | This Protocol is defined in Framework of EFI SMM Core Interface Spec\r | |
20 | Version 0.9.\r | |
21 | **/\r | |
22 | \r | |
23 | #ifndef _SMM_ACCESS_H_\r | |
24 | #define _SMM_ACCESS_H_\r | |
25 | \r | |
b80fbe85 | 26 | #include <Guid/SmramMemoryReserve.h>\r |
79964ac8 | 27 | \r |
28 | typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;\r | |
29 | \r | |
30 | #define EFI_SMM_ACCESS_PROTOCOL_GUID \\r | |
31 | { \\r | |
32 | 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r | |
33 | }\r | |
34 | \r | |
79964ac8 | 35 | //\r |
36 | // SMM Access specification Member Function\r | |
37 | //\r | |
38 | /**\r | |
39 | Opens the SMRAM area to be accessible by a boot-service driver.\r | |
40 | \r | |
41 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r | |
42 | @param DescriptorIndex Indicates that the driver wishes to open\r | |
43 | the memory tagged by this index.\r | |
44 | \r | |
45 | @retval EFI_SUCCESS The operation was successful.\r | |
46 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r | |
47 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r | |
48 | \r | |
49 | **/\r | |
50 | typedef\r | |
51 | EFI_STATUS\r | |
69686d56 | 52 | (EFIAPI *EFI_SMM_OPEN)(\r |
79964ac8 | 53 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
54 | UINTN DescriptorIndex\r | |
55 | );\r | |
56 | \r | |
57 | /**\r | |
58 | Inhibits access to the SMRAM.\r | |
59 | \r | |
60 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r | |
693c4e02 | 61 | @param DescriptorIndex Indicates that the driver wishes to close\r |
79964ac8 | 62 | the memory tagged by this index.\r |
63 | \r | |
64 | @retval EFI_SUCCESS The operation was successful.\r | |
65 | @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r | |
66 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r | |
67 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r | |
68 | \r | |
69 | **/\r | |
70 | typedef\r | |
71 | EFI_STATUS\r | |
69686d56 | 72 | (EFIAPI *EFI_SMM_CLOSE)(\r |
79964ac8 | 73 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
74 | UINTN DescriptorIndex\r | |
75 | );\r | |
76 | \r | |
77 | /**\r | |
78 | Inhibits access to the SMRAM.\r | |
693c4e02 | 79 | \r |
79964ac8 | 80 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r |
693c4e02 | 81 | @param DescriptorIndex Indicates that the driver wishes to lock\r |
79964ac8 | 82 | the memory tagged by this index.\r |
83 | \r | |
84 | @retval EFI_SUCCESS The operation was successful.\r | |
85 | @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r | |
86 | @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r | |
87 | @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r | |
88 | \r | |
89 | **/\r | |
90 | typedef\r | |
91 | EFI_STATUS\r | |
69686d56 | 92 | (EFIAPI *EFI_SMM_LOCK)(\r |
79964ac8 | 93 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
94 | UINTN DescriptorIndex\r | |
95 | );\r | |
96 | \r | |
97 | /**\r | |
98 | Queries the memory controller for the possible regions that will support SMRAM.\r | |
99 | \r | |
100 | @param This The EFI_SMM_ACCESS_PROTOCOL instance.\r | |
101 | @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r | |
102 | @param SmramMap A pointer to the buffer in which firmware places the current memory map.\r | |
103 | \r | |
104 | @retval EFI_SUCCESS The chipset supported the given resource.\r | |
105 | @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r | |
106 | \r | |
107 | **/\r | |
108 | typedef\r | |
109 | EFI_STATUS\r | |
69686d56 | 110 | (EFIAPI *EFI_SMM_CAPABILITIES)(\r |
79964ac8 | 111 | IN EFI_SMM_ACCESS_PROTOCOL *This,\r |
112 | IN OUT UINTN *SmramMapSize,\r | |
113 | IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap\r | |
114 | );\r | |
115 | \r | |
116 | /**\r | |
79964ac8 | 117 | This protocol is used to control the visibility of the SMRAM on the platform.\r |
79964ac8 | 118 | **/\r |
119 | struct _EFI_SMM_ACCESS_PROTOCOL {\r | |
2bbaeb0d | 120 | EFI_SMM_OPEN Open; ///< Opens the SMRAM.\r |
121 | EFI_SMM_CLOSE Close; ///< Closes the SMRAM.\r | |
122 | EFI_SMM_LOCK Lock; ///< Locks the SMRAM.\r | |
123 | EFI_SMM_CAPABILITIES GetCapabilities; ///< Gets information on possible SMRAM regions.\r | |
124 | BOOLEAN LockState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is locked.\r | |
125 | BOOLEAN OpenState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is open.\r | |
79964ac8 | 126 | };\r |
127 | \r | |
128 | extern EFI_GUID gEfiSmmAccessProtocolGuid;\r | |
129 | \r | |
130 | #endif\r |