]> git.proxmox.com Git - mirror_edk2.git/blob - OldMdePkg/Include/Protocol/SmmAccess.h
Adding top-level Conf directory for next generation of EDK II build infrastructure...
[mirror_edk2.git] / OldMdePkg / Include / Protocol / SmmAccess.h
1 /** @file
2 This file declares SMM SMRAM Access abstraction protocol
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: SmmAccess.h
14
15 @par Revision Reference:
16 This Protocol is defined in Framework of EFI SMM Core Interface Spec
17 Version 0.9.
18 **/
19
20 #ifndef _SMM_ACCESS_H_
21 #define _SMM_ACCESS_H_
22
23 typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
24
25 #define EFI_SMM_ACCESS_PROTOCOL_GUID \
26 { \
27 0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
28 }
29
30 //
31 // SMM Access specification constant and types
32 //
33 // *******************************************************
34 // EFI_SMRAM_STATE
35 // *******************************************************
36 //
37 #define EFI_SMRAM_OPEN 0x00000001
38 #define EFI_SMRAM_CLOSED 0x00000002
39 #define EFI_SMRAM_LOCKED 0x00000004
40 #define EFI_CACHEABLE 0x00000008
41 #define EFI_ALLOCATED 0x00000010
42
43 //
44 // SMM Access specification Member Function
45 //
46 /**
47 Opens the SMRAM area to be accessible by a boot-service driver.
48
49 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
50 @param DescriptorIndex Indicates that the driver wishes to open
51 the memory tagged by this index.
52
53 @retval EFI_SUCCESS The operation was successful.
54 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
55 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
56
57 **/
58 typedef
59 EFI_STATUS
60 (EFIAPI *EFI_SMM_OPEN) (
61 IN EFI_SMM_ACCESS_PROTOCOL *This,
62 UINTN DescriptorIndex
63 );
64
65 /**
66 Inhibits access to the SMRAM.
67
68 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
69 @param DescriptorIndex Indicates that the driver wishes to open
70 the memory tagged by this index.
71
72 @retval EFI_SUCCESS The operation was successful.
73 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
74 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
75 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
76
77 **/
78 typedef
79 EFI_STATUS
80 (EFIAPI *EFI_SMM_CLOSE) (
81 IN EFI_SMM_ACCESS_PROTOCOL *This,
82 UINTN DescriptorIndex
83 );
84
85 /**
86 Inhibits access to the SMRAM.
87 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
88 @param DescriptorIndex Indicates that the driver wishes to open
89 the memory tagged by this index.
90
91 @retval EFI_SUCCESS The operation was successful.
92 @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
93 @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
94 @retval EFI_NOT_STARTED The SMM base service has not been initialized.
95
96 **/
97 typedef
98 EFI_STATUS
99 (EFIAPI *EFI_SMM_LOCK) (
100 IN EFI_SMM_ACCESS_PROTOCOL *This,
101 UINTN DescriptorIndex
102 );
103
104 /**
105 Queries the memory controller for the possible regions that will support SMRAM.
106
107 @param This The EFI_SMM_ACCESS_PROTOCOL instance.
108 @param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
109 @param SmramMap A pointer to the buffer in which firmware places the current memory map.
110
111 @retval EFI_SUCCESS The chipset supported the given resource.
112 @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
113
114 **/
115 typedef
116 EFI_STATUS
117 (EFIAPI *EFI_SMM_CAPABILITIES) (
118 IN EFI_SMM_ACCESS_PROTOCOL *This,
119 IN OUT UINTN *SmramMapSize,
120 IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
121 );
122
123 /**
124 @par Protocol Description:
125 This protocol is used to control the visibility of the SMRAM on the platform.
126
127 @param Open
128 Opens the SMRAM.
129
130 @param Close
131 Closes the SMRAM.
132
133 @param Lock
134 Locks the SMRAM.
135
136 @param GetCapabilities
137 Gets information on possible SMRAM regions.
138
139 @param LockState
140 Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
141
142 @param OpenState
143 Indicates the current state of the SMRAM. Set to TRUE if any region is open.
144
145 **/
146 struct _EFI_SMM_ACCESS_PROTOCOL {
147 EFI_SMM_OPEN Open;
148 EFI_SMM_CLOSE Close;
149 EFI_SMM_LOCK Lock;
150 EFI_SMM_CAPABILITIES GetCapabilities;
151 BOOLEAN LockState;
152 BOOLEAN OpenState;
153 };
154
155 extern EFI_GUID gEfiSmmAccessProtocolGuid;
156
157 #endif