diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2020-04-11 04:02:14 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-04-21 02:20:51 +0000 |
commit | 309809455abef8bde99993f157ae5f3b9a1a05f6 (patch) | |
tree | 3bf95ac7914bff07bcd578f1310bc5c75a5c96db | |
parent | e33d3e7f564c7196fefa35b114e5f06b76267a40 (diff) | |
download | edk2-309809455abef8bde99993f157ae5f3b9a1a05f6.tar.gz edk2-309809455abef8bde99993f157ae5f3b9a1a05f6.tar.bz2 edk2-309809455abef8bde99993f157ae5f3b9a1a05f6.zip |
MdeModulePkg/EhciPei: Use BaseLib linked list iteration macros
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1959
Replaces usage of the linked list iteration macros defined in EhcPeim.h
with the common definition in BaseLib.h.
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
-rw-r--r-- | MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h | 16 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf | 2 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c | 3 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 5 |
4 files changed, 9 insertions, 17 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h index 6b69f7a656..8e5b6418e6 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h @@ -2,6 +2,7 @@ Private Header file for Usb Host Controller PEIM
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -17,6 +18,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <Ppi/IoMmu.h>
#include <Ppi/EndOfPeiPhase.h>
+#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
@@ -60,20 +62,6 @@ typedef struct _PEI_USB2_HC_DEV PEI_USB2_HC_DEV; //
#define EHC_SYNC_POLL_INTERVAL (6 * EHC_1_MILLISECOND)
-//
-//Iterate through the double linked list. NOT delete safe
-//
-#define EFI_LIST_FOR_EACH(Entry, ListHead) \
- for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
-
-//
-//Iterate through the double linked list. This is delete-safe.
-//Don't touch NextEntry
-//
-#define EFI_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \
- for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\
- Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)
-
#define EFI_LIST_CONTAINER(Entry, Type, Field) BASE_CR(Entry, Type, Field)
diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf b/MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf index 0fc09ffca4..01ebb371a7 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf @@ -5,6 +5,7 @@ # which is used to enable recovery function from USB Drivers.
#
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) Microsoft Corporation.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -47,6 +48,7 @@ [LibraryClasses]
IoLib
TimerLib
+ BaseLib
BaseMemoryLib
PeimEntryPoint
PeiServicesLib
diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c index 8eb432dfc3..311f501980 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -323,7 +324,7 @@ EhcCheckUrbResult ( goto ON_EXIT;
}
- EFI_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {
+ BASE_LIST_FOR_EACH (Entry, &Urb->Qh->Qtds) {
Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList);
QtdHw = &Qtd->QtdHw;
State = (UINT8) QtdHw->Status;
diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c index 995ccd2463..df512ed6fa 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -290,7 +291,7 @@ EhcFreeQtds ( EFI_LIST_ENTRY *Next;
PEI_EHC_QTD *Qtd;
- EFI_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) {
+ BASE_LIST_FOR_EACH_SAFE (Entry, Next, Qtds) {
Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList);
RemoveEntryList (&Qtd->QtdList);
@@ -461,7 +462,7 @@ EhcCreateQtds ( //
// OK, all the QTDs needed are created. Now, fix the NextQtd point
//
- EFI_LIST_FOR_EACH (Entry, &Qh->Qtds) {
+ BASE_LIST_FOR_EACH (Entry, &Qh->Qtds) {
Qtd = EFI_LIST_CONTAINER (Entry, PEI_EHC_QTD, QtdList);
//
|