public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure
@ 2019-01-04  2:41 Hao Wu
  2019-01-04  3:36 ` Bi, Dandan
  2019-01-04  4:14 ` Wang, Jian J
  0 siblings, 2 replies; 3+ messages in thread
From: Hao Wu @ 2019-01-04  2:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao Wu, Dandan Bi, Jian J Wang, Ruiyu Ni

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1425

This commit will resolve the VS2015 IA32 NOOPT build failure within
SdMmcPciHcDxe.

More specifically, this commit will use BaseLib API RShiftU64() to perform
right-shift operations for UINT64 type operators.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index 6086720fa1..5aec8c6992 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -1505,7 +1505,7 @@ BuildAdmaDescTable (
         Trb->Adma32Desc[Index].Valid = 1;
         Trb->Adma32Desc[Index].Act   = 2;
         if (DataLength26) {
-          Trb->Adma32Desc[Index].UpperLength = (UINT16)(Remaining >> 16);
+          Trb->Adma32Desc[Index].UpperLength = (UINT16)RShiftU64 (Remaining, 16);
         }
         Trb->Adma32Desc[Index].LowerLength = (UINT16)(Remaining & MAX_UINT16);
         Trb->Adma32Desc[Index].Address = (UINT32)Address;
@@ -1524,11 +1524,11 @@ BuildAdmaDescTable (
         Trb->Adma64Desc[Index].Valid = 1;
         Trb->Adma64Desc[Index].Act   = 2;
         if (DataLength26) {
-          Trb->Adma64Desc[Index].UpperLength  = (UINT16)(Remaining >> 16);
+          Trb->Adma64Desc[Index].UpperLength  = (UINT16)RShiftU64 (Remaining, 16);
         }
         Trb->Adma64Desc[Index].LowerLength  = (UINT16)(Remaining & MAX_UINT16);
         Trb->Adma64Desc[Index].LowerAddress = (UINT32)Address;
-        Trb->Adma64Desc[Index].UpperAddress = (UINT32)(Address >> 32);
+        Trb->Adma64Desc[Index].UpperAddress = (UINT32)RShiftU64 (Address, 32);
         break;
       } else {
         Trb->Adma64Desc[Index].Valid = 1;
@@ -1538,7 +1538,7 @@ BuildAdmaDescTable (
         }
         Trb->Adma64Desc[Index].LowerLength  = 0;
         Trb->Adma64Desc[Index].LowerAddress = (UINT32)Address;
-        Trb->Adma64Desc[Index].UpperAddress = (UINT32)(Address >> 32);
+        Trb->Adma64Desc[Index].UpperAddress = (UINT32)RShiftU64 (Address, 32);
       }
     }
 
-- 
2.12.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure
  2019-01-04  2:41 [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure Hao Wu
@ 2019-01-04  3:36 ` Bi, Dandan
  2019-01-04  4:14 ` Wang, Jian J
  1 sibling, 0 replies; 3+ messages in thread
From: Bi, Dandan @ 2019-01-04  3:36 UTC (permalink / raw)
  To: Wu, Hao A, edk2-devel@lists.01.org; +Cc: Wang, Jian J, Ni, Ray

Reviewed-by: Bi Dandan <dandan.bi@intel.com>

Thanks,
Dandan
> -----Original Message-----
> From: Wu, Hao A
> Sent: Friday, January 4, 2019 10:42 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Bi, Dandan <dandan.bi@intel.com>;
> Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT
> build failure
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1425
> 
> This commit will resolve the VS2015 IA32 NOOPT build failure within
> SdMmcPciHcDxe.
> 
> More specifically, this commit will use BaseLib API RShiftU64() to perform
> right-shift operations for UINT64 type operators.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> index 6086720fa1..5aec8c6992 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> @@ -1505,7 +1505,7 @@ BuildAdmaDescTable (
>          Trb->Adma32Desc[Index].Valid = 1;
>          Trb->Adma32Desc[Index].Act   = 2;
>          if (DataLength26) {
> -          Trb->Adma32Desc[Index].UpperLength = (UINT16)(Remaining >> 16);
> +          Trb->Adma32Desc[Index].UpperLength = (UINT16)RShiftU64
> + (Remaining, 16);
>          }
>          Trb->Adma32Desc[Index].LowerLength = (UINT16)(Remaining &
> MAX_UINT16);
>          Trb->Adma32Desc[Index].Address = (UINT32)Address; @@ -1524,11
> +1524,11 @@ BuildAdmaDescTable (
>          Trb->Adma64Desc[Index].Valid = 1;
>          Trb->Adma64Desc[Index].Act   = 2;
>          if (DataLength26) {
> -          Trb->Adma64Desc[Index].UpperLength  = (UINT16)(Remaining >> 16);
> +          Trb->Adma64Desc[Index].UpperLength  = (UINT16)RShiftU64
> + (Remaining, 16);
>          }
>          Trb->Adma64Desc[Index].LowerLength  = (UINT16)(Remaining &
> MAX_UINT16);
>          Trb->Adma64Desc[Index].LowerAddress = (UINT32)Address;
> -        Trb->Adma64Desc[Index].UpperAddress = (UINT32)(Address >> 32);
> +        Trb->Adma64Desc[Index].UpperAddress = (UINT32)RShiftU64
> + (Address, 32);
>          break;
>        } else {
>          Trb->Adma64Desc[Index].Valid = 1; @@ -1538,7 +1538,7 @@
> BuildAdmaDescTable (
>          }
>          Trb->Adma64Desc[Index].LowerLength  = 0;
>          Trb->Adma64Desc[Index].LowerAddress = (UINT32)Address;
> -        Trb->Adma64Desc[Index].UpperAddress = (UINT32)(Address >> 32);
> +        Trb->Adma64Desc[Index].UpperAddress = (UINT32)RShiftU64
> + (Address, 32);
>        }
>      }
> 
> --
> 2.12.0.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure
  2019-01-04  2:41 [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure Hao Wu
  2019-01-04  3:36 ` Bi, Dandan
@ 2019-01-04  4:14 ` Wang, Jian J
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Jian J @ 2019-01-04  4:14 UTC (permalink / raw)
  To: Wu, Hao A, edk2-devel@lists.01.org; +Cc: Bi, Dandan, Ni, Ray

Reviewed-by: Jian J Wang <jian.j.wang@intel.com>

> -----Original Message-----
> From: Wu, Hao A
> Sent: Friday, January 04, 2019 10:42 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Bi, Dandan <dandan.bi@intel.com>;
> Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT
> build failure
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1425
> 
> This commit will resolve the VS2015 IA32 NOOPT build failure within
> SdMmcPciHcDxe.
> 
> More specifically, this commit will use BaseLib API RShiftU64() to perform
> right-shift operations for UINT64 type operators.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu <hao.a.wu@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> index 6086720fa1..5aec8c6992 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> @@ -1505,7 +1505,7 @@ BuildAdmaDescTable (
>          Trb->Adma32Desc[Index].Valid = 1;
>          Trb->Adma32Desc[Index].Act   = 2;
>          if (DataLength26) {
> -          Trb->Adma32Desc[Index].UpperLength = (UINT16)(Remaining >> 16);
> +          Trb->Adma32Desc[Index].UpperLength = (UINT16)RShiftU64 (Remaining,
> 16);
>          }
>          Trb->Adma32Desc[Index].LowerLength = (UINT16)(Remaining &
> MAX_UINT16);
>          Trb->Adma32Desc[Index].Address = (UINT32)Address;
> @@ -1524,11 +1524,11 @@ BuildAdmaDescTable (
>          Trb->Adma64Desc[Index].Valid = 1;
>          Trb->Adma64Desc[Index].Act   = 2;
>          if (DataLength26) {
> -          Trb->Adma64Desc[Index].UpperLength  = (UINT16)(Remaining >> 16);
> +          Trb->Adma64Desc[Index].UpperLength  = (UINT16)RShiftU64 (Remaining,
> 16);
>          }
>          Trb->Adma64Desc[Index].LowerLength  = (UINT16)(Remaining &
> MAX_UINT16);
>          Trb->Adma64Desc[Index].LowerAddress = (UINT32)Address;
> -        Trb->Adma64Desc[Index].UpperAddress = (UINT32)(Address >> 32);
> +        Trb->Adma64Desc[Index].UpperAddress = (UINT32)RShiftU64 (Address, 32);
>          break;
>        } else {
>          Trb->Adma64Desc[Index].Valid = 1;
> @@ -1538,7 +1538,7 @@ BuildAdmaDescTable (
>          }
>          Trb->Adma64Desc[Index].LowerLength  = 0;
>          Trb->Adma64Desc[Index].LowerAddress = (UINT32)Address;
> -        Trb->Adma64Desc[Index].UpperAddress = (UINT32)(Address >> 32);
> +        Trb->Adma64Desc[Index].UpperAddress = (UINT32)RShiftU64 (Address, 32);
>        }
>      }
> 
> --
> 2.12.0.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-04  4:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-04  2:41 [PATCH] MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure Hao Wu
2019-01-04  3:36 ` Bi, Dandan
2019-01-04  4:14 ` Wang, Jian J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox