@param Length Specified length\r
@param Attributes Specified attributes\r
\r
- @retval EFI_SUCCESS Successfully set attribute of a segment of\r
- memory space.\r
+ @retval EFI_SUCCESS The attributes were set for the memory region.\r
+ @retval EFI_INVALID_PARAMETER Length is zero. \r
+ @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
+ resource range specified by BaseAddress and Length.\r
+ @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r
+ range specified by BaseAddress and Length.\r
+ @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by\r
+ BaseAddress and Length cannot be modified.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r
+ the memory resource range.\r
+ @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is\r
+ not available yet.\r
\r
**/\r
EFI_STATUS\r
@retval EFI_NOT_FOUND Free a non-using space or remove a non-exist\r
space, and so on.\r
@retval EFI_OUT_OF_RESOURCES No buffer could be allocated.\r
-\r
+ @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol\r
+ is not available yet.\r
**/\r
EFI_STATUS\r
CoreConvertSpace (\r
//\r
CpuArchAttributes = ConverToCpuArchAttributes (Attributes);\r
if (CpuArchAttributes != INVALID_CPU_ARCH_ATTRIBUTES) {\r
- if (gCpu != NULL) {\r
+ if (gCpu == NULL) {\r
+ Status = EFI_NOT_AVAILABLE_YET;\r
+ } else {\r
Status = gCpu->SetMemoryAttributes (\r
gCpu,\r
BaseAddress,\r
Length,\r
CpuArchAttributes\r
);\r
- if (EFI_ERROR (Status)) {\r
- goto Done;\r
- }\r
+ }\r
+ if (EFI_ERROR (Status)) {\r
+ CoreFreePool (TopEntry);\r
+ CoreFreePool (BottomEntry);\r
+ goto Done;\r
}\r
}\r
}\r
@param Length Specified length\r
@param Attributes Specified attributes\r
\r
- @retval EFI_SUCCESS Successfully set attribute of a segment of\r
- memory space.\r
+ @retval EFI_SUCCESS The attributes were set for the memory region.\r
+ @retval EFI_INVALID_PARAMETER Length is zero. \r
+ @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
+ resource range specified by BaseAddress and Length.\r
+ @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r
+ range specified by BaseAddress and Length.\r
+ @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by\r
+ BaseAddress and Length cannot be modified.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r
+ the memory resource range.\r
+ @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is\r
+ not available yet.\r
\r
**/\r
EFI_STATUS\r