Revision: 19632
          http://sourceforge.net/p/edk2/code/19632
Author:   erictian
Date:     2016-01-11 02:47:21 +0000 (Mon, 11 Jan 2016)
Log Message:
-----------
MdeModulePkg/NvmExpressDxe: Fix MS toolchain /Od 32bit build failure

Note NVME_ACQ & NVME_ASQ internal data structure are changed to make
build pass.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <[email protected]>
Reviewed-by: Hao Wu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
    trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
    trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.h

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c   
2016-01-11 02:46:36 UTC (rev 19631)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c   
2016-01-11 02:47:21 UTC (rev 19632)
@@ -2,7 +2,7 @@
   NvmExpressDxe driver is used to manage non-volatile memory subsystem which 
follows
   NVM Express specification.
 
-  Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -63,7 +63,7 @@
   CommandPacket.QueueType      = NVME_IO_QUEUE;
 
   CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;
-  CommandPacket.NvmeCmd->Cdw11 = (UINT32)(Lba >> 32);
+  CommandPacket.NvmeCmd->Cdw11 = (UINT32)RShiftU64(Lba, 32);
   CommandPacket.NvmeCmd->Cdw12 = (Blocks - 1) & 0xFFFF;
 
   CommandPacket.NvmeCmd->Flags = CDW10_VALID | CDW11_VALID | CDW12_VALID;
@@ -126,7 +126,7 @@
   CommandPacket.QueueType      = NVME_IO_QUEUE;
 
   CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;
-  CommandPacket.NvmeCmd->Cdw11 = (UINT32)(Lba >> 32);
+  CommandPacket.NvmeCmd->Cdw11 = (UINT32)RShiftU64(Lba, 32);
   CommandPacket.NvmeCmd->Cdw12 = (Blocks - 1) & 0xFFFF;
 
   CommandPacket.MetadataBuffer = NULL;

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c       
2016-01-11 02:46:36 UTC (rev 19631)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c       
2016-01-11 02:47:21 UTC (rev 19632)
@@ -2,7 +2,7 @@
   NvmExpressDxe driver is used to manage non-volatile memory subsystem which 
follows
   NVM Express specification.
 
-  Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -328,7 +328,7 @@
     return Status;
   }
 
-  DEBUG ((EFI_D_INFO, "Asq.Asqb: %lx\n", Asq->Asqb));
+  DEBUG ((EFI_D_INFO, "Asq: %lx\n", *Asq));
 
   return EFI_SUCCESS;
 }
@@ -408,7 +408,7 @@
     return Status;
   }
 
-  DEBUG ((EFI_D_INFO, "Acq.Acqb: %lxh\n", Acq->Acqb));
+  DEBUG ((EFI_D_INFO, "Acq: %lxh\n", *Acq));
 
   return EFI_SUCCESS;
 }
@@ -861,14 +861,12 @@
   //
   // Address of admin submission queue.
   //
-  Asq.Rsvd1 = 0;
-  Asq.Asqb  = (UINT64)(UINTN)(Private->BufferPciAddr) >> 12;
+  Asq = (UINT64)(UINTN)(Private->BufferPciAddr) & ~0xFFF;
 
   //
   // Address of admin completion queue.
   //
-  Acq.Rsvd1 = 0;
-  Acq.Acqb  = (UINT64)(UINTN)(Private->BufferPciAddr + EFI_PAGE_SIZE) >> 12;
+  Acq = (UINT64)(UINTN)(Private->BufferPciAddr + EFI_PAGE_SIZE) & ~0xFFF;
 
   //
   // Address of I/O submission & completion queue.

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.h
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.h       
2016-01-11 02:46:36 UTC (rev 19631)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.h       
2016-01-11 02:47:21 UTC (rev 19632)
@@ -109,18 +109,11 @@
 //
 // 3.1.9 Offset 28h: ASQ - Admin Submission Queue Base Address
 //
-typedef struct {
-  UINT64 Rsvd1:12;
-  UINT64 Asqb:52;    // Admin Submission Queue Base Address
-} NVME_ASQ;
-
+#define NVME_ASQ      UINT64
 //
 // 3.1.10 Offset 30h: ACQ - Admin Completion Queue Base Address
 //
-typedef struct {
-  UINT64 Rsvd1:12;
-  UINT64 Acqb:52;    // Admin Completion Queue Base Address
-} NVME_ACQ;
+#define NVME_ACQ      UINT64
 
 //
 // 3.1.11 Offset (1000h + ((2y) * (4 << CAP.DSTRD))): SQyTDBL - Submission 
Queue y Tail Doorbell


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to