]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmbeddedPkg: Remove dependency on TimerLib
authorOlivier Martin <olivier.martin@arm.com>
Wed, 6 May 2015 11:15:44 +0000 (11:15 +0000)
committeroliviermartin <oliviermartin@Edk2>
Wed, 6 May 2015 11:15:44 +0000 (11:15 +0000)
UEFI drivers should not depend on TimerLib. They should
use BS.Stall() instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17343 6f19259b-4bc3-4df7-8a09-765794883524

EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c
EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
EmbeddedPkg/EmbeddedPkg.dsc
EmbeddedPkg/Universal/MmcDxe/Mmc.h
EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c

index 77d4f2a837db959ce05452b6dcedd6ab6e9383f8..dfc3786297e22df66a470e523bddd40ebca03f4d 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -12,7 +12,6 @@
 \r
 **/\r
 \r
-#include <Library/TimerLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
index 7e0395a47f163d2e690216aa1183987508944a56..52ebc11c7fe6869854567a56248384f1bf23e928 100644 (file)
@@ -1,6 +1,6 @@
 #/** @file\r
 #\r
-#  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+#  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -27,7 +27,6 @@
   DebugLib\r
   IoLib\r
   MemoryAllocationLib\r
-  TimerLib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
 \r
index 392a7b537a06005d8d55b0ab6117c9d125e310e4..9e5f98b4bd1820f6bfa2a2a3196a47c4dd1e861f 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 #  INF file for the LAN9118 Network Controller Driver.\r
 #\r
-#  Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -40,7 +40,6 @@
   BaseMemoryLib\r
   ArmLib\r
   IoLib\r
-  TimerLib\r
   DevicePathLib\r
 \r
 [Protocols]\r
index d3f8e7c507ffdd84f7123ea9d79056e7ae17ca44..76c5ced38692f8cefbd85800e7bc56739580b063 100644 (file)
@@ -59,8 +59,6 @@
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
   EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf\r
 \r
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
 \r
   PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
   EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
   EmbeddedPkg/SerialDxe/SerialDxe.inf\r
   EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf\r
-  EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
+  EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf {\r
+    <LibraryClasses>\r
+      TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
+  }\r
 \r
   EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf\r
 \r
   # FDT installation\r
-  EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
-\r
-  EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf\r
+  EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {\r
+    <LibraryClasses>\r
+      # It depends on BdsLib that depends on TimerLib\r
+      TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
+  }\r
+\r
+  EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf {\r
+    <LibraryClasses>\r
+      # It depends on BdsLib that depends on TimerLib\r
+      TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
+  }\r
   EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf\r
   EmbeddedPkg/Drivers/AndroidFastbootTransportTcpDxe/FastbootTransportTcpDxe.inf\r
 \r
index 301561a282a124a0643c10eac6d13740eea81f11..46a156cecf88ab2999237728d8c7386d20ff039f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Main Header file for the MMC DXE driver\r
 \r
-  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -25,6 +25,7 @@
 \r
 #include <Library/UefiLib.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
 \r
 #define MMC_TRACE(txt)  DEBUG((EFI_D_BLKIO, "MMC: " txt "\n"))\r
 \r
index 04c82613d5b7b80f6641bdeaef6755cc1fcc2e55..0e1ef57263848a15318caa7a030b4f6b5d317e2a 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -13,7 +13,6 @@
 **/\r
 \r
 #include <Library/BaseMemoryLib.h>\r
-#include <Library/TimerLib.h>\r
 \r
 #include "Mmc.h"\r
 \r
@@ -268,7 +267,7 @@ MmcIoBlocks (
           break;  // Prevents delay once finished\r
         }\r
       }\r
-      NanoSecondDelay (100);\r
+      gBS->Stall (1);\r
     }\r
 \r
     Status = MmcNotifyState (MmcHostInstance, MmcTransferState);\r
index f9a2b9c70384483814d67d8ab6a25938e083040d..a07288c754418b8fd496e85ee02e8a88996db0d2 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 #  Build file for the MMC DXE driver\r
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -39,7 +39,6 @@
   UefiLib\r
   UefiDriverEntryPoint\r
   BaseMemoryLib\r
-  TimerLib\r
 \r
 [Protocols]\r
   gEfiDiskIoProtocolGuid\r
index 08cc405ed8f1d633603462cc29e8238808a66179..2d8038ffe02f14ff66e0fb0d2958279eda2ca2ff 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -12,8 +12,6 @@
 *\r
 **/\r
 \r
-#include <Library/TimerLib.h>\r
-\r
 #include "Mmc.h"\r
 \r
 typedef union {\r
@@ -322,7 +320,7 @@ MmcIdentificationMode (
 \r
     if (!EFI_ERROR (Status)) {\r
       if (!MmcHostInstance->CardInfo.OCRData.PowerUp) {\r
-        MicroSecondDelay (1);\r
+        gBS->Stall (1);\r
         Timeout--;\r
       } else {\r
         if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) {\r
@@ -332,7 +330,7 @@ MmcIdentificationMode (
         break;  // The MMC/SD card is ready. Continue the Identification Mode\r
       }\r
     } else {\r
-      MicroSecondDelay (1);\r
+      gBS->Stall (1);\r
       Timeout--;\r
     }\r
   }\r