]> xenbits.xensource.com Git - ovmf.git/commitdiff
Add volatile keyword to NvmExpressPei's Passthru CQ
authorOliver Smith-Denny <osde@linux.microsoft.com>
Thu, 27 Apr 2023 17:36:22 +0000 (01:36 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 8 May 2023 01:56:16 +0000 (01:56 +0000)
This applies the volatile keyword and appropriate casts
to the NvmExpressPei's Passthru CQ.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c

index 5081b53cd5e84690917038f109f1392d7f456507..ac9328047feffa6a7af7a96a984b89a8df6acbe3 100644 (file)
@@ -115,7 +115,7 @@ NvmeCreatePrpList (
 **/\r
 EFI_STATUS\r
 NvmeCheckCqStatus (\r
-  IN NVME_CQ  *Cq\r
+  IN volatile NVME_CQ  *Cq\r
   )\r
 {\r
   if ((Cq->Sct == 0x0) && (Cq->Sc == 0x0)) {\r
@@ -344,7 +344,7 @@ NvmePassThruExecute (
 {\r
   EFI_STATUS             Status;\r
   NVME_SQ                *Sq;\r
-  NVME_CQ                *Cq;\r
+  volatile NVME_CQ       *Cq;\r
   UINT8                  QueueId;\r
   UINTN                  SqSize;\r
   UINTN                  CqSize;\r
@@ -617,7 +617,7 @@ NvmePassThruExecute (
   //\r
   // Copy the Respose Queue entry for this command to the callers response buffer\r
   //\r
-  CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION));\r
+  CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION));\r
 \r
   //\r
   // Check the NVMe cmd execution result\r