[if gte mso 9]>

Re: [edk2] [patch] Stall.c in rev12822 is wrong for 32bit

Subject: Re: [edk2] [patch] Stall.c in rev12822 is wrong for 32bit

From: "Sun, Rui" <rui.sun@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2011-12-07 20:45:27

Sergey,

 

The purpose of this patch is to follow the UEFI spec which requires that the Stall() function stall execution on the processor for at least the requested number of microseconds.

 

It is expected that the “if (Microseconds > 0x1999999999999999ULL) {}” block will be optimized away with 32-bit build.
 
Could you tell me which tool chain you are using that generated the warning message?

 

 

From: Andrew Fish [mailto:afish@apple.com]
Sent: Wednesday, December 07, 2011 9:05 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [patch] Stall.c in rev12822 is wrong for 32bit

 

Sergey,

 

What compiler where you using? I don't see this failure with Xcode 4.2 as the -Wno-tautological-compare compiler flag makes this compare not be regarded as an error.

 

Andrew Fish

 

 

On Dec 6, 2011, at 9:34 AM, Sergey Isakov wrote:



Dear sirs,

Compiling recent update I encounter an error

-------------

edk2/MdeModulePkg/Core/Dxe/Misc/Stall.c:70: warning: comparison is always false due to limited range of data type

-------------

The argument should be UINT64 but not UINTN

----------------

--- DxeMain-old.h       2011-11-23 20:57:38.000000000 +0400

+++ DxeMain.h          2011-12-06 21:25:41.000000000 +0400

@@ -565,7 +565,7 @@ CoreRestoreTpl (

 EFI_STATUS

 EFIAPI

 CoreStall (

-  IN UINTN            Microseconds

+  IN UINT64            Microseconds

   );

----------------

--- Stall-old.c   2011-12-06 20:16:44.000000000 +0400

+++ Stall.c      2011-12-06 21:22:43.000000000 +0400

@@ -52,7 +52,7 @@ CoreInternalWaitForTick (

 EFI_STATUS

 EFIAPI

 CoreStall (

-  IN UINTN            Microseconds

+  IN UINT64            Microseconds

   )

 {

   UINT64  Counter;

------------------------

 

Regards

Sergey

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel