MdeModulePkg SmmMemoryAttribute.h: Refine some comments
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / SmmMemoryAttribute.h
CommitLineData
e63da9f0
JW
1/** @file\r
2 SMM Memory Attribute Protocol provides retrieval and update service\r
3 for memory attributes in EFI SMM environment.\r
4\r
5942b32e 5 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
e63da9f0
JW
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __SMM_MEMORYATTRIBUTE_H__\r
17#define __SMM_MEMORYATTRIBUTE_H__\r
18\r
19//{69B792EA-39CE-402D-A2A6-F721DE351DFE}\r
20#define EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL_GUID \\r
21 { \\r
22 0x69b792ea, 0x39ce, 0x402d, { 0xa2, 0xa6, 0xf7, 0x21, 0xde, 0x35, 0x1d, 0xfe } \\r
23 }\r
24\r
25typedef struct _EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL;\r
26\r
27/**\r
28 This function set given attributes of the memory region specified by\r
29 BaseAddress and Length.\r
30\r
31 @param This The EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL instance.\r
32 @param BaseAddress The physical address that is the start address of\r
33 a memory region.\r
34 @param Length The size in bytes of the memory region.\r
35 @param Attributes The bit mask of attributes to set for the memory\r
36 region.\r
37\r
38 @retval EFI_SUCCESS The attributes were set for the memory region.\r
39 @retval EFI_INVALID_PARAMETER Length is zero.\r
40 Attributes specified an illegal combination of\r
41 attributes that cannot be set together.\r
42 @retval EFI_UNSUPPORTED The processor does not support one or more\r
43 bytes of the memory resource range specified\r
44 by BaseAddress and Length.\r
5942b32e 45 The bit mask of attributes is not supported for\r
e63da9f0
JW
46 the memory resource range specified by\r
47 BaseAddress and Length.\r
48\r
49**/\r
50typedef\r
51EFI_STATUS\r
52(EFIAPI *EDKII_SMM_SET_MEMORY_ATTRIBUTES)(\r
53 IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This,\r
54 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
55 IN UINT64 Length,\r
56 IN UINT64 Attributes\r
57 );\r
58\r
59/**\r
60 This function clears given attributes of the memory region specified by\r
61 BaseAddress and Length.\r
62\r
63 @param This The EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL instance.\r
64 @param BaseAddress The physical address that is the start address of\r
65 a memory region.\r
66 @param Length The size in bytes of the memory region.\r
5942b32e 67 @param Attributes The bit mask of attributes to clear for the memory\r
e63da9f0
JW
68 region.\r
69\r
5942b32e 70 @retval EFI_SUCCESS The attributes were cleared for the memory region.\r
e63da9f0
JW
71 @retval EFI_INVALID_PARAMETER Length is zero.\r
72 Attributes specified an illegal combination of\r
5942b32e 73 attributes that cannot be cleared together.\r
e63da9f0
JW
74 @retval EFI_UNSUPPORTED The processor does not support one or more\r
75 bytes of the memory resource range specified\r
76 by BaseAddress and Length.\r
5942b32e 77 The bit mask of attributes is not supported for\r
e63da9f0
JW
78 the memory resource range specified by\r
79 BaseAddress and Length.\r
80\r
81**/\r
82typedef\r
83EFI_STATUS\r
84(EFIAPI *EDKII_SMM_CLEAR_MEMORY_ATTRIBUTES)(\r
85 IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This,\r
86 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
87 IN UINT64 Length,\r
88 IN UINT64 Attributes\r
89 );\r
90\r
91/**\r
5942b32e 92 This function retrieves the attributes of the memory region specified by\r
e63da9f0
JW
93 BaseAddress and Length. If different attributes are got from different part\r
94 of the memory region, EFI_NO_MAPPING will be returned.\r
95\r
96 @param This The EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL instance.\r
97 @param BaseAddress The physical address that is the start address of\r
98 a memory region.\r
99 @param Length The size in bytes of the memory region.\r
100 @param Attributes Pointer to attributes returned.\r
101\r
102 @retval EFI_SUCCESS The attributes got for the memory region.\r
103 @retval EFI_INVALID_PARAMETER Length is zero.\r
104 Attributes is NULL.\r
105 @retval EFI_NO_MAPPING Attributes are not consistent cross the memory\r
106 region.\r
107 @retval EFI_UNSUPPORTED The processor does not support one or more\r
108 bytes of the memory resource range specified\r
109 by BaseAddress and Length.\r
e63da9f0
JW
110\r
111**/\r
112typedef\r
113EFI_STATUS\r
114(EFIAPI *EDKII_SMM_GET_MEMORY_ATTRIBUTES)(\r
115 IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This,\r
116 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
117 IN UINT64 Length,\r
118 OUT UINT64 *Attributes\r
119 );\r
120\r
121///\r
122/// SMM Memory Attribute Protocol provides services to retrieve or update\r
123/// attribute of memory in the EFI SMM environment.\r
124///\r
125struct _EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL {\r
126 EDKII_SMM_GET_MEMORY_ATTRIBUTES GetMemoryAttributes;\r
127 EDKII_SMM_SET_MEMORY_ATTRIBUTES SetMemoryAttributes;\r
128 EDKII_SMM_CLEAR_MEMORY_ATTRIBUTES ClearMemoryAttributes;\r
129};\r
130\r
131extern EFI_GUID gEdkiiSmmMemoryAttributeProtocolGuid;\r
132\r
133#endif\r