The NvmExpressPei driver is used to manage non-volatile memory subsystem\r
which follows NVM Express specification at PEI phase.\r
\r
- Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
}\r
\r
/**\r
- Free the resources allocated by an NVME controller.\r
+ Free the DMA resources allocated by an NVME controller.\r
\r
@param[in] Private The pointer to the PEI_NVME_CONTROLLER_PRIVATE_DATA data structure.\r
\r
**/\r
VOID\r
-NvmeFreeControllerResource (\r
+NvmeFreeDmaResource (\r
IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private\r
)\r
{\r
- //\r
- // Free the controller data buffer\r
- //\r
- if (Private->ControllerData != NULL) {\r
- FreePool (Private->ControllerData);\r
- Private->ControllerData = NULL;\r
- }\r
+ ASSERT (Private != NULL);\r
\r
- //\r
- // Free the DMA buffers\r
- //\r
- if (Private->Buffer != NULL) {\r
+ if (Private->BufferMapping != NULL) {\r
IoMmuFreeBuffer (\r
NVME_MEM_MAX_PAGES,\r
Private->Buffer,\r
Private->BufferMapping\r
);\r
- Private->Buffer = NULL;\r
}\r
\r
- //\r
- // Free the namespaces information buffer\r
- //\r
- if (Private->NamespaceInfo != NULL) {\r
- FreePool (Private->NamespaceInfo);\r
- Private->NamespaceInfo = NULL;\r
- }\r
-\r
- //\r
- // Free the controller private data structure\r
- //\r
- FreePool (Private);\r
return;\r
}\r