From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.4616.1630045373186639517 for ; Thu, 26 Aug 2021 23:22:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=T5ZydIsR; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10088"; a="217622648" X-IronPort-AV: E=Sophos;i="5.84,355,1620716400"; d="scan'208";a="217622648" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2021 23:22:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,355,1620716400"; d="scan'208";a="427026344" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 26 Aug 2021 23:22:51 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 26 Aug 2021 23:22:51 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Thu, 26 Aug 2021 23:22:51 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 26 Aug 2021 23:22:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d9Mz48A2xqH1CmuO2JzPpN+rhun4Tty6CNToij9JW1CYra0JO43NSD+P00hqR50qJzvLZ/mj5THQ1ZgbgXuQkSygVcdXsSgtzY5qq9SJZXwa3BbD3ziOuZFOW22FXJOe+rxOhtVpDDVH+Dyw7x+KY4jj2etcV8e6Z63HGJ2Z5XwAs9RZocN3/uSnw9Uq7NVx73+hjSZDbV/8sVl5aqWCPijvACye/A3Pn/zUQPUrUsa5nem6vpMImGpXqfwN38Fpif9a4PRRyGckIUS9SGTXPzXSa3sZJOUOj1MIgX5+4BlB81t5IDFCnydBz4EaF4ftFxhJ27ac5UqtPsV3n0Dkww== 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=Bl0FQZ4wcgFtmYIjxT9poGmE7nrKMeQ4XgaNyFdSqT4=; b=Z97nhKr7kzN93F48P5RfMaEcE5WxZgm3IIHsOMy9Wo8cCu0RrjCdkCfzlZcnh9nu3e74EU64gbwUNG3HyWkmbz/e2mRExd4c8uJQxO0nGvdM5XNFHKHc7Kb4trX4cQuDKLnpDnHrOaAsxZffoSsEIuaGYrP9zraHAkRtXCGDwNLLyNhZ+UC95dAzppb28Nt8eJCJk63ys6tAU9dfOxXmBhylQPOZhy+g6fsFn29oeOYvQ9S9Sj+alMNx4yILJ/jxWPKBe4rqrnR01QFMfzrCfJVw/k+LMJQoDbrm3gNpoJ9Tqx5o0X9y6YzI1EimPmkutO9LY4DEfWClFoD5e96n5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bl0FQZ4wcgFtmYIjxT9poGmE7nrKMeQ4XgaNyFdSqT4=; b=T5ZydIsRAGBdCkr/L7Sm05hrCTKeWDOxH0RF94wydgVZtXmR1m923kH0uzjpfOoXLAQ/wrvuHLqe+Efp95TJflBGyCfxEq1X2Mx1yQjN1gGQgctExVbC3jAhNG20ihzGe8tZ95ar0zl8PiWUnQVkzyZM46QANPXH8+qVhyuQdzg= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by CO1PR11MB4834.namprd11.prod.outlook.com (2603:10b6:303:90::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.21; Fri, 27 Aug 2021 06:22:45 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::c98d:a1f9:48a8:8865]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::c98d:a1f9:48a8:8865%6]) with mapi id 15.20.4436.027; Fri, 27 Aug 2021 06:22:45 +0000 From: "Ni, Ray" To: "Lin, JackX" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Dong, Eric" , "Yao, Jiewen" , "Chaganty, Rangasai V" , "Kuo, Donald" , "Kumar, Chandana C" Subject: Re: [edk2-platforms: PATCH V10 2/2] Platform/Intel: Correct CPU APIC IDs Thread-Topic: [edk2-platforms: PATCH V10 2/2] Platform/Intel: Correct CPU APIC IDs Thread-Index: AQHXmwlxRYeO2eLD5E2nL92u3VjtvquG4Zmw Date: Fri, 27 Aug 2021 06:22:44 +0000 Message-ID: References: <20210827060420.2311-1-JackX.Lin@intel.com> <20210827060420.2311-2-JackX.Lin@intel.com> In-Reply-To: <20210827060420.2311-2-JackX.Lin@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ba1d7ed0-c310-4807-104d-08d969231534 x-ms-traffictypediagnostic: CO1PR11MB4834: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0nd1bg68CiXiJlaC1qU2Jpw+r+Z7+eE9rot/FHbRODU5THIGXyUi1dGAqvVahZ9AyAEOt6C9YoG8UZ1EwE7QIcEWcvYOJhyL/gkkiY1XcKa5zonv6GHVzZwjRA3kLNpaJB6x3p0RdlEJyQWGGK00G9ILRdGMNqrqEqC+JakmuYbAPdnPYXBBV2kA8O9mAVbeD4n5RjCBFYX9/kkE5ucincGaY2Gf9nCL48Vk9sKceUyr3O6EsBdp38Jj87EqorYc36ke6yexVD8oMaECZD0aAdh2u5cBWIIJV/u7HVE4MgWmQ+wUCOK4hx6hievcr46t+cYC9PXcpclfFkcMNsi+nfqYHrDybjArNKEGhoWD7YuhFBfTpb9H733y05/69muOz2lio8MQSqcM0RaoaD3tc1CA2lgCePVKzZAw1N+IRRjRCktRPV/Ow955wjn7pndSgx73qtsTY1d+w1tEVYVgeDWAvvlQk510eoswcgKdpBWGp+pMo1kwU5P5cAgMGZC63x08mpWaQ7T5n0R6OhMlpVbElZx/kXvv1yTGgjIlzgqT2w72zOY968plnrKM793BRvdAY65FbR413T6m8mwh7O0k5T9C01Z3gi4Ts9YqjAJrP80ufuA4APqQtq1/XYTjVHV4q7ZtAaM8A2UiIiS1q5lWCf69ZPzPxjEp5cfH920f+glwazf9CR+/RPmZxFsNSPfugkBeWFWRlQnmC+vdR9vicxbBMp4Sp+R81wM5goAwpGnz0ia6QfR1kJmJ53FRcpc3Bn+ipGDDPDgJVWgeysyX2IasQQdY5ZhC4rGY9XO+qcRMlHzr+fhqB1/Fqk+o x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(136003)(376002)(346002)(39860400002)(316002)(110136005)(8676002)(54906003)(8936002)(66476007)(83380400001)(122000001)(2906002)(33656002)(26005)(19627235002)(38100700002)(38070700005)(52536014)(66946007)(107886003)(4326008)(7696005)(53546011)(186003)(55016002)(71200400001)(76116006)(86362001)(66446008)(966005)(6506007)(64756008)(5660300002)(9686003)(30864003)(478600001)(66556008)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?POeyjDjhZCV4pFpk3k7vbzH3MJnhooggp7d55ZXFJtKEEb/J9wXp5s7/snXw?= =?us-ascii?Q?eOs2YdpSA4RkDP0rswJtDyyqY8YbMLuV+mEgU1oYZwbV4KzpsWk9W4JvLPsI?= =?us-ascii?Q?82leo9lXGTr3ZMNCcaPFv4NxsVagH127pFceDUlYVAJncZTRuOiXoG/Ct8RM?= =?us-ascii?Q?+Uj1fDbFOyTJc7Xy0X+vjRX0QkS70oMfNjFEi+a67xhkc/N2o2rABnHQIFjC?= =?us-ascii?Q?WHmkVwzO+dPLEhH7hX1gek+EG6SBDmq7yQNp0DJQb+o8AXKoW4juimBI2EAT?= =?us-ascii?Q?yStVwuV1Zp0wPlfbffFUUzrU6TyHbtyH++XtbX4Hn0Shxg1nFi2anklEABoo?= =?us-ascii?Q?0DfwoVzM0mHngzI1tdop402+7HTqcskrCStDwEdB2tw9VwtuFJxVjg2QCXEl?= =?us-ascii?Q?ds1QgleXZ/qmWBxwWXmgZGEXaKIg8YJ3EIiOIn59SHtyL2I9VRB6HHvB+7SX?= =?us-ascii?Q?ntPC1QRtAiPCEmEfoebsgli5lFM5RT/CLpaJ0Y6i9Ni/D3hV7se/sEOtMbT5?= =?us-ascii?Q?2AyTH7QiPn/5FE3bMHkPE3wlhTUG56Mq5IRGZvRdyviIYOc04SQuAf+i/lL1?= =?us-ascii?Q?qiBWfLOGA6tITB1swi2SQdLQJ7AEjwZlY3piHm0NqVc+5+IeGl5qDZ8rS8Qt?= =?us-ascii?Q?RuqhBbEFeVrUTZxdvcj0PHNTHBNvN1q949dFXBA+KSNLnhFseTNQwFHPv3Bc?= =?us-ascii?Q?BnXHJMCO7/Rh4gLidp1wR80w/v2eGjOKAHmWToaDRl6qQuK69jUJiPAD9SHE?= =?us-ascii?Q?vw79loWbrxfF4qUgxVYZdMoPifPF80VWFP82UkTthhu9yYQtoOAtKpd4zViT?= =?us-ascii?Q?8155FtLHfpsd49iSkscCLVAhl7c5l2QXpt4fg/wkw6fxclfuU0e47T1brMpy?= =?us-ascii?Q?ZIlKYeP+pI9mrAutJTSOhl47yReUt7UKKMIVmLWXJny2xP4wI3Vxr5r709Sr?= =?us-ascii?Q?q0V5rqlbZtVhYmdBGT8yV/Uhs4TNlF+pZPZ5vnd1rIs6nQ77GduvNqpgJNq4?= =?us-ascii?Q?iRZeKZ50Xgrxw6VwXYBBLi+J3WbMHSXZvUIwWtmhXm7jBR20Idni39D3QzA9?= =?us-ascii?Q?ouB29HtbXwZ8mTcj6+LA+aIIh6C1J2vocYKkkVoOGqle3HtJfhpyULYgx3L7?= =?us-ascii?Q?LZN8U2C7oTii4NBLyerVn/SKH8abIGi4FftUjjGp/w3bWzZAG4SCGOd592zi?= =?us-ascii?Q?SBFuH2p5i83xv2aRPTo5dSeBJavAU3P1K1OEi/+IAJ4tLvSlVzCrW4HHI9fN?= =?us-ascii?Q?fCmWa4pxUxajUIsYai+l6TwP+O302QNc3HMwlzK11QE+583muZDlmOKPM0Sl?= =?us-ascii?Q?V8spDBHIaRr+mXLmBh+aw5Vj?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba1d7ed0-c310-4807-104d-08d969231534 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2021 06:22:44.9195 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9qI56Wc3GuFx4qDESs1Fn6AxqeGZgyXkCVAQYj2ScAtR0skYNbgiNDVsI+Sv4K6eFnyA8sApj/zRufqh2MZ8Rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4834 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni -----Original Message----- From: Lin, JackX =20 Sent: Friday, August 27, 2021 2:04 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Dong, Eric ;= Yao, Jiewen ; Ni, Ray ; Chaganty, = Rangasai V ; Kuo, Donald ; Kumar, Chandana C Subject: [edk2-platforms: PATCH V10 2/2] Platform/Intel: Correct CPU APIC I= Ds REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3365 Correct coding style Signed-off-by: JackX Lin Cc: Chasel Chiu Cc: Dong Eric Cc: Jiewen Yao Cc: Ray Ni Cc: Rangasai V Chaganty Cc: Donald Kuo Cc: Chandana C Kumar Cc: JackX Lin --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 238 +++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++----------------------------------------= ---------------------------------------------------------------------------= ------ 1 file changed, 117 insertions(+), 121 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index ab3296d68a..c03d899163 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -49,7 +49,7 @@ VOID *mLocalTable[] =3D { &Wsmt, }; =20 -EFI_ACPI_TABLE_PROTOCOL *mAcpiTable; +EFI_ACPI_TABLE_PROTOCOL *mAcpiTable; =20 UINT32 mNumOfBitShift =3D 6; BOOLEAN mForceX2ApicId; @@ -215,7 +215,7 @@ SortCpuLocalApicInTable ( } //end for CurrentProcessor =20 //keep for debug purpose - DEBUG(( EFI_D_ERROR, "::ACPI:: APIC ID Order Table Init. CoreThreadMa= sk =3D %x, mNumOfBitShift =3D %x\n", CoreThreadMask, mNumOfBitShift)); + DEBUG ((DEBUG_INFO, "::ACPI:: APIC ID Order Table Init. CoreThreadMas= k =3D %x, mNumOfBitShift =3D %x\n", CoreThreadMask, mNumOfBitShift)); DebugDisplayReOrderTable (TempCpuApicIdOrderTable); =20 // @@ -238,7 +238,7 @@ SortCpuLocalApicInTable ( } =20 if (mNumberOfCpus <=3D Index) { - DEBUG ((EFI_D_ERROR, "Asserting the SortCpuLocalApicInTable Index Bu= fferflow\n")); + DEBUG ((DEBUG_ERROR, "Asserting the SortCpuLocalApicInTable Index=20 + Bufferflow\n")); return EFI_INVALID_PARAMETER; } } @@ -293,7 +293,7 @@ SortCpuLocalApicInTable ( } =20 //keep for debug purpose - DEBUG ((EFI_D_ERROR, "APIC ID Order Table ReOrdered\n")); + DEBUG ((DEBUG_INFO, "APIC ID Order Table ReOrdered\n")); DebugDisplayReOrderTable (mCpuApicIdOrderTable); =20 mCpuOrderSorted =3D TRUE; @@ -493,11 +493,11 @@ InitializeMadtHeader ( } =20 Status =3D InitializeHeader ( - &MadtHeader->Header, - EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, - EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, - 0 - ); + &MadtHeader->Header, + EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, + 0 + ); if (EFI_ERROR (Status)) { return Status; } @@ -675,11 +675,11 @@ BuildAcpiTable ( // Allocate the memory needed for the table. // Status =3D AllocateTable ( - TableSpecificHdrLength, - Structures, - StructureCount, - &InternalTable - ); + TableSpecificHdrLength, + Structures, + StructureCount, + &InternalTable + ); if (EFI_ERROR (Status)) { return Status; } @@ -771,7 +771,7 @@ InstallMadtFromScratch ( // Call for Local APIC ID Reorder Status =3D SortCpuLocalApicInTable (); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "SortCpuLocalApicInTable failed: %r\n", Status)); + DEBUG ((DEBUG_ERROR, "SortCpuLocalApicInTable failed: %r\n",=20 + Status)); goto Done; } =20 @@ -801,11 +801,11 @@ InstallMadtFromScratch ( // Status =3D InitializeMadtHeader (&MadtTableHeader); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "InitializeMadtHeader failed: %r\n", Status)); + DEBUG ((DEBUG_ERROR, "InitializeMadtHeader failed: %r\n", Status)); goto Done; } =20 - DEBUG ((EFI_D_INFO, "Number of CPUs detected =3D %d \n", mNumberOfCpus))= ; + DEBUG ((DEBUG_INFO, "Number of CPUs detected =3D %d \n",=20 + mNumberOfCpus)); =20 // // Build Processor Local APIC Structures and Processor Local X2APIC Stru= ctures @@ -831,10 +831,10 @@ InstallMadtFromScratch ( =20 ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &ProcLocalApicStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &ProcLocalApicStruct, + &MadtStructs[MadtStructsIndex++] + ); } else if (mCpuApicIdOrderTable[Index].ApicId !=3D 0xFFFFFFFF) { ProcLocalX2ApicStruct.Flags =3D (UINT8) mCpuApicIdOrderTa= ble[Index].Flags; ProcLocalX2ApicStruct.X2ApicId =3D mCpuApicIdOrderTable[Inde= x].ApicId; @@ -842,13 +842,13 @@ InstallMadtFromScratch ( =20 ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &ProcLocalX2ApicStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &ProcLocalX2ApicStruct, + &MadtStructs[MadtStructsIndex++] + ); } if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (local APIC/x2APIC) failed: = %r\n", Status)); + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (local APIC/x2APIC)=20 + failed: %r\n", Status)); goto Done; } } @@ -860,44 +860,44 @@ InstallMadtFromScratch ( IoApicStruct.Length =3D sizeof (EFI_ACPI_4_0_IO_APIC_STRUCTURE); IoApicStruct.Reserved =3D 0; =20 - PcIoApicEnable =3D PcdGet32(PcdPcIoApicEnable); + PcIoApicEnable =3D PcdGet32 (PcdPcIoApicEnable); =20 - if (FixedPcdGet32(PcdMaxCpuSocketCount) <=3D 4) { + if (FixedPcdGet32 (PcdMaxCpuSocketCount) <=3D 4) { IoApicStruct.IoApicId =3D PcdGet8(PcdIoApicId); IoApicStruct.IoApicAddress =3D PcdGet32(PcdIoApicAddress); IoApicStruct.GlobalSystemInterruptBase =3D 0; ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &IoApicStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &IoApicStruct, + &MadtStructs[MadtStructsIndex++] + ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (I/O APIC) failed: %r\n", St= atus)); + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (I/O APIC) failed: %r\n",=20 + Status)); goto Done; } } =20 for (PcIoApicIndex =3D 0; PcIoApicIndex < PcdGet8(PcdPcIoApicCount); PcI= oApicIndex++) { - PcIoApicMask =3D (1 << PcIoApicIndex); - if ((PcIoApicEnable & PcIoApicMask) =3D=3D 0) { - continue; - } + PcIoApicMask =3D (1 << PcIoApicIndex); + if ((PcIoApicEnable & PcIoApicMask) =3D=3D 0) { + continue; + } =20 - IoApicStruct.IoApicId =3D (UINT8)(PcdGet8(PcdPcIoAp= icIdBase) + PcIoApicIndex); - IoApicStruct.IoApicAddress =3D CurrentIoApicAddress; - CurrentIoApicAddress =3D (CurrentIoApicAddress & 0= xFFFF8000) + 0x8000; - IoApicStruct.GlobalSystemInterruptBase =3D (UINT32)(24 + (PcIoApicIn= dex * 8)); - ASSERT (MadtStructsIndex < MaxMadtStructCount); - Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &IoApicStruct, - &MadtStructs[MadtStructsIndex++] - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (I/O APIC) failed: %r\n", = Status)); - goto Done; - } + IoApicStruct.IoApicId =3D (UINT8)(PcdGet8(PcdPcIoApic= IdBase) + PcIoApicIndex); + IoApicStruct.IoApicAddress =3D CurrentIoApicAddress; + CurrentIoApicAddress =3D (CurrentIoApicAddress & 0xF= FFF8000) + 0x8000; + IoApicStruct.GlobalSystemInterruptBase =3D (UINT32)(24 + (PcIoApicInde= x * 8)); + ASSERT (MadtStructsIndex < MaxMadtStructCount); + Status =3D CopyStructure ( + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &IoApicStruct, + &MadtStructs[MadtStructsIndex++] + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (I/O APIC) failed: %r\n", St= atus)); + goto Done; + } } =20 // @@ -916,12 +916,12 @@ InstallMadtFromScratch ( =20 ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &IntSrcOverrideStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &IntSrcOverrideStruct, + &MadtStructs[MadtStructsIndex++] + ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (IRQ2 source override) failed:= %r\n", Status)); + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (IRQ2 source override)=20 + failed: %r\n", Status)); goto Done; } =20 @@ -935,12 +935,12 @@ InstallMadtFromScratch ( =20 ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &IntSrcOverrideStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &IntSrcOverrideStruct, + &MadtStructs[MadtStructsIndex++] + ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (IRQ9 source override) failed:= %r\n", Status)); + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (IRQ9 source override)=20 + failed: %r\n", Status)); goto Done; } =20 @@ -955,12 +955,12 @@ InstallMadtFromScratch ( =20 ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &LocalApciNmiStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &LocalApciNmiStruct, + &MadtStructs[MadtStructsIndex++] + ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "CopyMadtStructure (APIC NMI) failed: %r\n", Stat= us)); + DEBUG ((DEBUG_ERROR, "CopyMadtStructure (APIC NMI) failed: %r\n",=20 + Status)); goto Done; } =20 @@ -979,10 +979,10 @@ InstallMadtFromScratch ( =20 ASSERT (MadtStructsIndex < MaxMadtStructCount); Status =3D CopyStructure ( - &MadtTableHeader.Header, - (STRUCTURE_HEADER *) &LocalX2ApicNmiStruct, - &MadtStructs[MadtStructsIndex++] - ); + &MadtTableHeader.Header, + (STRUCTURE_HEADER *) &LocalX2ApicNmiStruct, + &MadtStructs[MadtStructsIndex++] + ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "CopyMadtStructure (x2APIC NMI) failed: %r\n", = Status)); goto Done; @@ -993,14 +993,14 @@ InstallMadtFromScratch ( // Build Madt Structure from the Madt Header and collection of pointers = in MadtStructs[] // Status =3D BuildAcpiTable ( - (EFI_ACPI_DESCRIPTION_HEADER *) &MadtTableHeader, - sizeof (EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER), - MadtStructs, - MadtStructsIndex, - (UINT8 **)&NewMadtTable - ); + (EFI_ACPI_DESCRIPTION_HEADER *) &MadtTableHeader, + sizeof (EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER), + MadtStructs, + MadtStructsIndex, + (UINT8 **) &NewMadtTable + ); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "BuildAcpiTable failed: %r\n", Status)); + DEBUG ((DEBUG_ERROR, "BuildAcpiTable failed: %r\n", Status)); goto Done; } =20 @@ -1008,11 +1008,11 @@ InstallMadtFromScratch ( // Publish Madt Structure to ACPI // Status =3D mAcpiTable->InstallAcpiTable ( - mAcpiTable, - NewMadtTable, - NewMadtTable->Header.Length, - &TableHandle - ); + mAcpiTable, + NewMadtTable, + NewMadtTable->Header.Length, + &TableHandle + ); =20 Done: // @@ -1054,8 +1054,8 @@ InstallMcfgFromScratch ( PciSegmentInfo =3D GetPciSegmentInfo (&SegmentCount); =20 McfgTable =3D AllocateZeroPool ( - sizeof(EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_T= ABLE_HEADER) + - sizeof(EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE= _BASE_ADDRESS_ALLOCATION_STRUCTURE) * SegmentCount + sizeof (EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_= TABLE_HEADER) + + sizeof=20 + (EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLO + CATION_STRUCTURE) * SegmentCount ); if (McfgTable =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "Could not allocate MCFG structure\n")); @@ -1063= ,11 +1063,11 @@ InstallMcfgFromScratch ( } =20 Status =3D InitializeHeader ( - &McfgTable->Header, - EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRES= S_DESCRIPTION_TABLE_SIGNATURE, - EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION, - 0 - ); + &McfgTable->Header, + EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BA= SE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVIS= ION, + 0 + ); if (EFI_ERROR (Status)) { return Status; } @@ -1091,11 +1091,11 @@ InstallMcfgFromScratch ( // Publish Madt Structure to ACPI // Status =3D mAcpiTable->InstallAcpiTable ( - mAcpiTable, - McfgTable, - McfgTable->Header.Length, - &TableHandle - ); + mAcpiTable, + McfgTable, + McfgTable->Header.Length, + &TableHandle + ); =20 return Status; } @@ -1179,7 +1179,7 @@ PlatformUpdateTables ( switch (Table->Signature) { =20 case EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE: - ASSERT(FALSE); + ASSERT (FALSE); break; =20 case EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE: @@ -1223,9 +1223,9 @@ PlatformUpdateTables ( FadtHeader->XGpe1Blk.AccessSize =3D 0; } =20 - DEBUG(( EFI_D_ERROR, "ACPI FADT table @ address 0x%x\n", Table )); - DEBUG(( EFI_D_ERROR, " IaPcBootArch 0x%x\n", FadtHeader->IaPcBootArch= )); - DEBUG(( EFI_D_ERROR, " Flags 0x%x\n", FadtHeader->Flags )); + DEBUG ((DEBUG_INFO, "ACPI FADT table @ address 0x%x\n", Table)); + DEBUG ((DEBUG_INFO, " IaPcBootArch 0x%x\n", FadtHeader->IaPcBootArch)= ); + DEBUG ((DEBUG_INFO, " Flags 0x%x\n", FadtHeader->Flags)); break; =20 case EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE: @@ -1245,12 +1245,12 @@ PlatformUpdateTables ( HpetBlockId.Bits.VendorId =3D HpetCapabilities.Bits.VendorId; HpetTable->EventTimerBlockId =3D HpetBlockId.Uint32; HpetTable->MainCounterMinimumClockTickInPeriodicMode =3D (UINT16)HpetC= apabilities.Bits.CounterClockPeriod; - DEBUG(( EFI_D_ERROR, "ACPI HPET table @ address 0x%x\n", Table )); - DEBUG(( EFI_D_ERROR, " HPET base 0x%x\n", PcdGet32 (PcdHpetBaseAddres= s) )); + DEBUG ((DEBUG_INFO, "ACPI HPET table @ address 0x%x\n", Table)); + DEBUG ((DEBUG_INFO, " HPET base 0x%x\n", PcdGet32=20 + (PcdHpetBaseAddress))); break; =20 case EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADD= RESS_DESCRIPTION_TABLE_SIGNATURE: - ASSERT(FALSE); + ASSERT (FALSE); break; =20 default: @@ -1302,8 +1302,8 @@ IsHardwareChange ( // pFADT->XDsdt // HWChangeSize =3D HandleCount + 1; - HWChange =3D AllocateZeroPool( sizeof(UINT32) * HWChangeSize ); - ASSERT( HWChange !=3D NULL ); + HWChange =3D AllocateZeroPool (sizeof(UINT32) * HWChangeSize); =20 + ASSERT(HWChange !=3D NULL); =20 if (HWChange =3D=3D NULL) return; =20 @@ -1344,14 +1344,14 @@ IsHardwareChange ( // Calculate CRC value with HWChange data. // Status =3D gBS->CalculateCrc32(HWChange, HWChangeSize, &CRC); - DEBUG((DEBUG_INFO, "CRC =3D %x and Status =3D %r\n", CRC, Status)); + DEBUG ((DEBUG_INFO, "CRC =3D %x and Status =3D %r\n", CRC, Status)); =20 // // Set HardwareSignature value based on CRC value. // FacsPtr =3D (EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)pFADT= ->FirmwareCtrl; FacsPtr->HardwareSignature =3D CRC; - FreePool( HWChange ); + FreePool (HWChange); } =20 VOID @@ -1374,17 +1374,16 @@ UpdateLocalTable ( =20 if (Version !=3D EFI_ACPI_TABLE_VERSION_NONE) { Status =3D mAcpiTable->InstallAcpiTable ( - mAcpiTable, - CurrentTable, - CurrentTable->Length, - &TableHandle - ); + mAcpiTable, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); ASSERT_EFI_ERROR (Status); } } } =20 - VOID EFIAPI AcpiEndOfDxeEvent ( @@ -1392,16 +1391,14 @@ AcpiEndOfDxeEvent ( VOID *ParentImageHandle ) { - if (Event !=3D NULL) { - gBS->CloseEvent(Event); + gBS->CloseEvent (Event); } =20 - // // Calculate Hardware Signature value based on current platform configur= ations // - IsHardwareChange(); + IsHardwareChange (); } =20 /** @@ -1425,7 +1422,6 @@ InstallAcpiPlatform ( EFI_STATUS Status; EFI_EVENT EndOfDxeEvent; =20 - Status =3D gBS->LocateProtocol (&gEfiMpServiceProtocolGuid, NULL, (VOID = **)&mMpService); ASSERT_EFI_ERROR (Status); =20 @@ -1449,10 +1445,10 @@ InstallAcpiPlatform ( // Determine the number of processors // mMpService->GetNumberOfProcessors ( - mMpService, - &mNumberOfCpus, - &mNumberOfEnabledCPUs - ); + mMpService, + &mNumberOfCpus, + &mNumberOfEnabledCPUs + ); =20 DEBUG ((DEBUG_INFO, "mNumberOfCpus - %d\n", mNumberOfCpus)); DEBUG ((DEBUG_INFO, "mNumberOfEnabledCPUs - %d\n", mNumberOfEnabledCPUs)= ); @@ -1461,7 +1457,7 @@ InstallAcpiPlatform ( DEBUG ((DEBUG_INFO, "mForceX2ApicId - 0x%x\n", mForceX2ApicId)); =20 // support up to 64 threads/socket - AsmCpuidEx(CPUID_EXTENDED_TOPOLOGY, 1, &mNumOfBitShift, NULL, NULL, NULL= ); + AsmCpuidEx (CPUID_EXTENDED_TOPOLOGY, 1, &mNumOfBitShift, NULL, NULL,=20 + NULL); mNumOfBitShift &=3D 0x1F; DEBUG ((DEBUG_INFO, "mNumOfBitShift - 0x%x\n", mNumOfBitShift)); =20 -- 2.32.0.windows.2