]> xenbits.xensource.com Git - ovmf.git/commitdiff
Add the volatile keyword to NvmExpressDxe's Passthru CQ
authorOliver Smith-Denny <osde@linux.microsoft.com>
Thu, 27 Apr 2023 17:36:21 +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 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 <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/NvmExpressDxe/NvmExpressPassthru.c

index f37baa626a1695ed871eacffd8e371373d87eb43..2ff2cb0e8d361e297fb56840fb6134ca5f7e2ee5 100644 (file)
@@ -460,7 +460,7 @@ NvmExpressPassThru (
   EFI_STATUS                     PreviousStatus;\r
   EFI_PCI_IO_PROTOCOL            *PciIo;\r
   NVME_SQ                        *Sq;\r
-  NVME_CQ                        *Cq;\r
+  volatile NVME_CQ               *Cq;\r
   UINT16                         QueueId;\r
   UINT16                         QueueSize;\r
   UINT32                         Bytes;\r
@@ -815,14 +815,14 @@ NvmExpressPassThru (
       // Dump every completion entry status for debugging.\r
       //\r
       DEBUG_CODE_BEGIN ();\r
-      NvmeDumpStatus (Cq);\r
+      NvmeDumpStatus ((NVME_CQ *)Cq);\r
       DEBUG_CODE_END ();\r
     }\r
 \r
     //\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
   } else {\r
     //\r
     // Timeout occurs for an NVMe command. Reset the controller to abort the\r