]>
Commit | Line | Data |
---|---|---|
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 |
9d510e61 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
e63da9f0 JW |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef __SMM_MEMORYATTRIBUTE_H__\r | |
11 | #define __SMM_MEMORYATTRIBUTE_H__\r | |
12 | \r | |
13 | //{69B792EA-39CE-402D-A2A6-F721DE351DFE}\r | |
14 | #define EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL_GUID \\r | |
15 | { \\r | |
16 | 0x69b792ea, 0x39ce, 0x402d, { 0xa2, 0xa6, 0xf7, 0x21, 0xde, 0x35, 0x1d, 0xfe } \\r | |
17 | }\r | |
18 | \r | |
19 | typedef struct _EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL;\r | |
20 | \r | |
21 | /**\r | |
22 | This function set given attributes of the memory region specified by\r | |
23 | BaseAddress and Length.\r | |
24 | \r | |
25 | @param This The EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL instance.\r | |
26 | @param BaseAddress The physical address that is the start address of\r | |
27 | a memory region.\r | |
28 | @param Length The size in bytes of the memory region.\r | |
29 | @param Attributes The bit mask of attributes to set for the memory\r | |
30 | region.\r | |
31 | \r | |
32 | @retval EFI_SUCCESS The attributes were set for the memory region.\r | |
33 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
34 | Attributes specified an illegal combination of\r | |
35 | attributes that cannot be set together.\r | |
36 | @retval EFI_UNSUPPORTED The processor does not support one or more\r | |
37 | bytes of the memory resource range specified\r | |
38 | by BaseAddress and Length.\r | |
5942b32e | 39 | The bit mask of attributes is not supported for\r |
e63da9f0 JW |
40 | the memory resource range specified by\r |
41 | BaseAddress and Length.\r | |
42 | \r | |
43 | **/\r | |
44 | typedef\r | |
45 | EFI_STATUS\r | |
46 | (EFIAPI *EDKII_SMM_SET_MEMORY_ATTRIBUTES)(\r | |
47 | IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This,\r | |
48 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
49 | IN UINT64 Length,\r | |
50 | IN UINT64 Attributes\r | |
51 | );\r | |
52 | \r | |
53 | /**\r | |
54 | This function clears given attributes of the memory region specified by\r | |
55 | BaseAddress and Length.\r | |
56 | \r | |
57 | @param This The EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL instance.\r | |
58 | @param BaseAddress The physical address that is the start address of\r | |
59 | a memory region.\r | |
60 | @param Length The size in bytes of the memory region.\r | |
5942b32e | 61 | @param Attributes The bit mask of attributes to clear for the memory\r |
e63da9f0 JW |
62 | region.\r |
63 | \r | |
5942b32e | 64 | @retval EFI_SUCCESS The attributes were cleared for the memory region.\r |
e63da9f0 JW |
65 | @retval EFI_INVALID_PARAMETER Length is zero.\r |
66 | Attributes specified an illegal combination of\r | |
5942b32e | 67 | attributes that cannot be cleared together.\r |
e63da9f0 JW |
68 | @retval EFI_UNSUPPORTED The processor does not support one or more\r |
69 | bytes of the memory resource range specified\r | |
70 | by BaseAddress and Length.\r | |
5942b32e | 71 | The bit mask of attributes is not supported for\r |
e63da9f0 JW |
72 | the memory resource range specified by\r |
73 | BaseAddress and Length.\r | |
74 | \r | |
75 | **/\r | |
76 | typedef\r | |
77 | EFI_STATUS\r | |
78 | (EFIAPI *EDKII_SMM_CLEAR_MEMORY_ATTRIBUTES)(\r | |
79 | IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This,\r | |
80 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
81 | IN UINT64 Length,\r | |
82 | IN UINT64 Attributes\r | |
83 | );\r | |
84 | \r | |
85 | /**\r | |
5942b32e | 86 | This function retrieves the attributes of the memory region specified by\r |
e63da9f0 JW |
87 | BaseAddress and Length. If different attributes are got from different part\r |
88 | of the memory region, EFI_NO_MAPPING will be returned.\r | |
89 | \r | |
90 | @param This The EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL instance.\r | |
91 | @param BaseAddress The physical address that is the start address of\r | |
92 | a memory region.\r | |
93 | @param Length The size in bytes of the memory region.\r | |
94 | @param Attributes Pointer to attributes returned.\r | |
95 | \r | |
96 | @retval EFI_SUCCESS The attributes got for the memory region.\r | |
97 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
98 | Attributes is NULL.\r | |
99 | @retval EFI_NO_MAPPING Attributes are not consistent cross the memory\r | |
100 | region.\r | |
101 | @retval EFI_UNSUPPORTED The processor does not support one or more\r | |
102 | bytes of the memory resource range specified\r | |
103 | by BaseAddress and Length.\r | |
e63da9f0 JW |
104 | \r |
105 | **/\r | |
106 | typedef\r | |
107 | EFI_STATUS\r | |
108 | (EFIAPI *EDKII_SMM_GET_MEMORY_ATTRIBUTES)(\r | |
109 | IN EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL *This,\r | |
110 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
111 | IN UINT64 Length,\r | |
112 | OUT UINT64 *Attributes\r | |
113 | );\r | |
114 | \r | |
115 | ///\r | |
116 | /// SMM Memory Attribute Protocol provides services to retrieve or update\r | |
117 | /// attribute of memory in the EFI SMM environment.\r | |
118 | ///\r | |
119 | struct _EDKII_SMM_MEMORY_ATTRIBUTE_PROTOCOL {\r | |
120 | EDKII_SMM_GET_MEMORY_ATTRIBUTES GetMemoryAttributes;\r | |
121 | EDKII_SMM_SET_MEMORY_ATTRIBUTES SetMemoryAttributes;\r | |
122 | EDKII_SMM_CLEAR_MEMORY_ATTRIBUTES ClearMemoryAttributes;\r | |
123 | };\r | |
124 | \r | |
125 | extern EFI_GUID gEdkiiSmmMemoryAttributeProtocolGuid;\r | |
126 | \r | |
127 | #endif\r |