From: Oliver Smith-Denny Date: Thu, 27 Apr 2023 17:36:21 +0000 (+0800) Subject: Add the volatile keyword to NvmExpressDxe's Passthru CQ X-Git-Tag: edk2-stable202305~51 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=293b97d0c4624c13a4e934294d2c4b161a09a91b;p=ovmf.git Add the volatile keyword to NvmExpressDxe's Passthru CQ This updates the relevant functions that expect a non-volatile structure to be passed to them to take casts of the CQ now that it is volatile. Cc: Hao A Wu Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Cc: Michael Kubacki Cc: Sean Brogan Signed-off-by: Oliver Smith-Denny Reviewed-by: Hao A Wu Acked-by: Michael Kubacki --- diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index f37baa626a..2ff2cb0e8d 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -460,7 +460,7 @@ NvmExpressPassThru ( EFI_STATUS PreviousStatus; EFI_PCI_IO_PROTOCOL *PciIo; NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_CQ *Cq; UINT16 QueueId; UINT16 QueueSize; UINT32 Bytes; @@ -815,14 +815,14 @@ NvmExpressPassThru ( // Dump every completion entry status for debugging. // DEBUG_CODE_BEGIN (); - NvmeDumpStatus (Cq); + NvmeDumpStatus ((NVME_CQ *)Cq); DEBUG_CODE_END (); } // // Copy the Respose Queue entry for this command to the callers response buffer // - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION)); + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION)); } else { // // Timeout occurs for an NVMe command. Reset the controller to abort the