From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.92.21.16]) by mx.groups.io with SMTP id smtpd.web11.4848.1586548969381557817 for ; Fri, 10 Apr 2020 13:02:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=IUW0O2L3; spf=pass (domain: outlook.com, ip: 40.92.21.16, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=agIdf6aw0f4FU8oH9TDxuFkRgMoGY1A/iOTRtmjjGKvB9rEt8sAt7muxwwxTUupPkHBxUR2iOSTnKfxhUSoGmkHKFKwO4xyxniez6jrNsUgnf1hnGXew+Q9zpXpTdrSDFotswQkw2BqdSs5zTW2KsWvW/AHu4wIlnhVhZOR8QNR0RsFfVTAmbqAZz0jgnkY9NFP971kSjZ4DJpM3lIgxeHnR5XbPV9dTek4n1qNDh/FWxyGFGCUCESIM9KoMqTintXd+kHLBnESVt8Npzd+UBH5XgAer8LupHAD/Q3/kR5jpQr1ciu8NagQRkkBDw/kTDIj4Fo+ON7PHCUSck8wccQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yll+EC8a6wEPdaDpyLCpCWB4k5axnm1WJG67xj8a9Ts=; b=UhIe+U0Dee8Ggvw8fMsylSUBSgmpo2nLNdM2TqgnEjs1lOzuvYm6iG80HFrc5p2OPQFWRueDqQK2Nb6rRZ2WkWRumtnrNgWzjQfpt6N0MQdv4G8iPzX8wvyjqmr/TrrmNxgAPWofrnnOSQJFRMDmgiErpxLOOMIHrWnKYBIn962u6vPOSdDv3YG5eWtN3lEWnN/SzOX96xFBPx2Y9LLV+ROeYx35BasdMvtMP4vntbKbSeMIq2oHF1VbBBc0DZ0bjFqRWYOZua1eTPxW1upKaOKbYdcg06rf2pV5AlR+j8CX8apZg7Q4k2a7xe5b94VrUkSGfPn4T6I0ug9DSN2lNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yll+EC8a6wEPdaDpyLCpCWB4k5axnm1WJG67xj8a9Ts=; b=IUW0O2L3V9ldgbSPnO70v3M+xZYcJyle9h/YBgguXzjl7y+i94w1mGjh6iNbMr2jzy9adTWYKm6L6K1ro2lXqrRu6icqEdD+a4QEVG+qIDg665RXYP3/IPWSFvraxs/TwQ4sbawW41qyAgYNPysPEttvqeNx6KNjdi/vRNkWTLFqFoAwBaHvn3JqHINkeBnesjlt6IC6+XXCF/PlwbBjCa3+RjNWr2SUmy2t6Se3IodE+gIPbzO9wok0CaGn9PWNDQAR3b6vJ2gWZ28fY21NJ9/c/9MwqrTgRB8sLbCqS9HISYxCFIeWQJ8SeFl6mv6ttI6iS7wH7UDmGxM6rcYToQ== Received: from MW2NAM12FT048.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::49) by MW2NAM12HT184.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::353) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.12; Fri, 10 Apr 2020 20:02:45 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:fc65::48) by MW2NAM12FT048.mail.protection.outlook.com (2a01:111:e400:fc65::215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.12 via Frontend Transport; Fri, 10 Apr 2020 20:02:45 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:25255B543455C92163B19641065257E2E2CBE2063A0F0B9CD7981D0D6138A437;UpperCasedChecksum:7ED6C1275BEFD2EA67AE1A8C5AB42EF150C25F5CC52C5B7CB3BBC2ED8534DAD1;SizeAsReceived:7892;Count:49 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::bcc9:271b:20db:52e3]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::bcc9:271b:20db:52e3%6]) with mapi id 15.20.2900.015; Fri, 10 Apr 2020 20:02:45 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Dandan Bi , Hao A Wu , Jian J Wang , Liming Gao , Ray Ni , Sean Brogan Subject: [PATCH v2 3/7] MdeModulePkg/EhciPei: Use BaseLib linked list iteration macros Date: Fri, 10 Apr 2020 13:02:14 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 In-Reply-To: <20200410200218.24992-1-michael.kubacki@outlook.com> References: <20200410200218.24992-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR01CA0033.prod.exchangelabs.com (2603:10b6:300:101::19) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200410200218.24992-4-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:1:71cb:63a2:e2d4:2255) by MWHPR01CA0033.prod.exchangelabs.com (2603:10b6:300:101::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Fri, 10 Apr 2020 20:02:45 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200410200218.24992-4-michael.kubacki@outlook.com> X-TMN: [6jaPoWIo0FGsFH/FN/DlWOI9NTHDmQbsFJMHkaB9LqiNzcvh6smVtgYX5l5qhWzw] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 722bfd9e-d335-48a8-6676-08d7dd8a22f2 X-MS-TrafficTypeDiagnostic: MW2NAM12HT184: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i1XX5+IAABjQsNXB4hOgXOkfIzloSSh3F3qslpnT0PB+nqbLsHrzDYddXH1OVBmeYZ2B9DBuKjGGIQ2WUXDrsNxePX4W1MD60ltjy4ah0bUoA9jXikktHVJIC4LpVMyQFltGtkYBROilj2ZvSYaIdJKoIsUvecVV+PoJ09mxdTxExeiF07Mdoq6UNHTq9nQa51HXar7KMRvZSAS7X6AuSmmH+OJwqH0ZaguuvGam//8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR07MB3440.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: X4IhZfXgjKzZToNhnQO8yEjqLOhlf36+us9eBadt9ZI5sgROcG1JcqOWKzxBUKxDHl3uY2I03fsXFbN1fZVIUyEqb1BBhl8DWltTO7wh14jbkJMpixKYcqw9IF5Sg1aZjEyKGc9xtzELcj0oG0I+relI7GVVHvPk8JLB0IhMFgm7lWGpjl3zWdD+tx+2EOM8ZbY/ociYsAUy2JPeFZVhFg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 722bfd9e-d335-48a8-6676-08d7dd8a22f2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2020 20:02:45.9210 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM12HT184 Content-Type: text/plain From: Michael Kubacki 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 Cc: Hao A Wu Cc: Jian J Wang Cc: Liming Gao Cc: Ray Ni Cc: Sean Brogan Signed-off-by: Michael Kubacki Reviewed-by: Guomin Jiang Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c | 3 ++- MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 5 +++-- MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h | 16 ++-------------- MdeModulePkg/Bus/Pci/EhciPei/EhciPei.inf | 2 ++ 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciSched.c index 8eb432dfc31d..311f50198062 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.
+Copyright (c) Microsoft Corporation.
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 995ccd2463d2..df512ed6fa59 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.
+Copyright (c) Microsoft Corporation.
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); // diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.h index 6b69f7a656ce..8e5b6418e6ee 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.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -17,6 +18,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include +#include #include #include #include @@ -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 0fc09ffca434..01ebb371a72e 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.
+# Copyright (c) Microsoft Corporation.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -47,6 +48,7 @@ [LibraryClasses] IoLib TimerLib + BaseLib BaseMemoryLib PeimEntryPoint PeiServicesLib -- 2.16.3.windows.1