From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.63]) by mx.groups.io with SMTP id smtpd.web10.2784.1663191317407941420 for ; Wed, 14 Sep 2022 14:35:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=owBwa1Ll; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.220.63, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X2j7D8YcBx1ojdBMbNp69OYZh0xOECNRbaloeexXxnMZT+9nsiw83OSjGV2g/jpYfXXSSb/pm5b9Nity78GjEjDbAUr+g1Akuih5w1pmStn/NNn6E8XofF3JYgROSlTHpZBFrzpCJuvw5BlM/rM362/b0wRM3APOPprQc3h0Mb8IMFLMGJQFAaa0er7W4YbO9AIYZiDvwWUHdJ+wnRfTHANVTa0xTxFsHQVf9mewaIITbrufSc9lUHINCOD3d453qbe2baJZ2FwNvnQp0nEAQGy42rC8/NYtLj72bsOuQkgjVdFmHb3W6HLHOKv0+/L07m3dU3213ON+rphBBl/7FQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iY6ZS2Rai0svUmUYq2JKTZoWQ+vi1mM7DOqTbxnX/vI=; b=BIGeHUiMtIz+zLP5px4tgAYDVlmjExEeN7LqlFQre7+BI3jqqvdvKvkPl5IsTkUNEsSBOegtj6e34K75V2woK4m2Cc30i0H9V81o/WwflavrfTz6x/8lKRws3qXXktZFgOqbcn9EXMUuCMMN+3vRmNEwsdcvLlDU69fEt0dvanvv3SEGJjehXDSaUKZy3acVfYnFQSdFp38KhFBSxMfEwz2xdZnTHpYLDvLDUSoAu5oECKlOhbLQveVL3LcvNP5Bl5OTIXlzXyfnuOV7VmKLdb4qEcrBVvtSZaS0mwK4OeusclwHx+n32ReQBRe28/UHmMJghclmbWLrGw8xQMKhpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iY6ZS2Rai0svUmUYq2JKTZoWQ+vi1mM7DOqTbxnX/vI=; b=owBwa1LlKLJJ+87fHHSMiK6AGYwH2A7Zawqe1aHTxT6vzzCMaZ+i1ZOretgqbW4ZpbiAgXWvxoHY3QyVTAoVa87g6vFbd3/TF2/LPrOOF4E+Kw6aKcqiQLarEwoOhKANbERuLUM7gQmIiGH19FElBWG7EydYB/4SDILDRU+WAbf8rlH0mEamxmogASeOT9Gwiy8wgc+WCtP8pBb8qglWZTKEkXunHPsTg5FXRvrXzyUVlaQ+1r5S+0etZm/nY9YzRiZ9A4RuJpQaBKvoCtl6FvBwkvhAQpcYbJn408RVWNSGNKdS5YIa9dqgXtHF9Ir8TPtbCyyZjVsSWpnJtvFvoQ== Received: from DM6PR02CA0060.namprd02.prod.outlook.com (2603:10b6:5:177::37) by SJ0PR12MB5424.namprd12.prod.outlook.com (2603:10b6:a03:300::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.23; Wed, 14 Sep 2022 21:35:14 +0000 Received: from DM6NAM11FT076.eop-nam11.prod.protection.outlook.com (2603:10b6:5:177:cafe::e) by DM6PR02CA0060.outlook.office365.com (2603:10b6:5:177::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Wed, 14 Sep 2022 21:35:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT076.mail.protection.outlook.com (10.13.173.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Wed, 14 Sep 2022 21:35:13 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 14 Sep 2022 14:35:02 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 14 Sep 2022 14:35:01 -0700 Received: from f153882e4be8.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Wed, 14 Sep 2022 14:35:01 -0700 From: "Jeff Brasen" To: CC: , , , , Jeff Brasen Subject: [PATCH v2 2/3] DynamicTablesPkg: AML Code generation to add _CPC entries Date: Wed, 14 Sep 2022 15:34:51 -0600 Message-ID: <7e67444227e4ae3c29da18aded47507c0dbd8603.1663191097.git.jbrasen@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-NVConfidentiality: public Return-Path: jbrasen@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT076:EE_|SJ0PR12MB5424:EE_ X-MS-Office365-Filtering-Correlation-Id: 23e55a1f-175a-4524-e9a6-08da9699025e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PtcJsKxrVBpHxlw2hSPHX6o7mdb6t+N/ytEX6uyhUZaYJ++aOO9z/bKbo4U/G0jj5c9ZFyWQTJ2u61Dkaq5+Aod2ROTvo3WWMN/JAf7u/bcxa2toj4oGWQnMTZfxSz+4bWxfqPon8Bk4wNCWtl80CYudD/JPQP2491pJLEDcJWz90r2oCnVp/TomKLtNT04eFUNhIRVdNWnfVbN/u+oeZEqkJFnlh1ThswdYCwTcuTE5orsKKOnxzmusSkIEhZOFEDzFav2x5yFF2qJc5fr3NBPTQ9BpmxIQwj47LIdbcC6n2XV2v1TO+R5zcCAEAJieNoZpjL/5zngK7h1+JtMDzJH0ZMZHp65POrS/8b8VlffklagO/KXr43YHjV0IixrOVLiN/s3AsiLfil6v+91QWY9ObwAldkF00WG/8Y35tzF0to3rBnEeITQUhrN3jj50+WH2wIsPDzTQZKeHh5Ozdl5bQOOdHv30bXK+ZKYbasfNnU2U8vRUrR/Zsd4S7rrAZNFxv81uBFPUA/bVGIL54n1dlo1DCebf2UORcY66Nt/uRwk7nn4xVqRDhB8kkgmw49GAPKzUbWlEOQNapDJhj33wnKScly28MxtY5VhnGSinrp29FeKIwWAGLN3BNBs62XBYaotmIfnrMAo1BU9AsnEn9eBS9gVvzgypalGqvAWUqEdvu43q9ZwH+YN+Lm+MPPcNpeRBMA7C/e85F4bVoj8zYVvD1CACvilLZ+AK/dastcQFSQS50SEuyujoDorGJBg1GMnxmyFzo0J6PvjUsg== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199015)(40470700004)(36840700001)(46966006)(2906002)(36860700001)(26005)(54906003)(30864003)(6916009)(316002)(478600001)(40460700003)(19627235002)(186003)(107886003)(5660300002)(7696005)(8936002)(86362001)(2616005)(83380400001)(70206006)(70586007)(8676002)(4326008)(36756003)(426003)(41300700001)(47076005)(6666004)(336012)(7636003)(40480700001)(82740400003)(82310400005)(356005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 21:35:13.8877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23e55a1f-175a-4524-e9a6-08da9699025e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT076.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5424 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain _CPC entries can describe CPU performance information.=0D The object is described in ACPI 6.4 s8.4.7.1.=0D "_CPC (Continuous Performance Control)".=0D =0D Add AmlCreateCpcNode() helper function to add _CPC entries to an=0D existing CPU object.=0D =0D Signed-off-by: Jeff Brasen =0D ---=0D .../Include/Library/AmlLib/AmlLib.h | 156 +++++=0D .../Common/AmlLib/CodeGen/AmlCodeGen.c | 543 ++++++++++++++++++=0D 2 files changed, 699 insertions(+)=0D =0D diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTabl= esPkg/Include/Library/AmlLib/AmlLib.h=0D index 39968660f2..3fafa6b0e8 100644=0D --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h=0D +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h=0D @@ -1336,6 +1336,162 @@ AmlAddNameIntegerPackage (=0D IN AML_OBJECT_NODE_HANDLE PackageNode=0D );=0D =0D +/** Create a _CPC node.=0D +=0D + Creates and optionally adds the following node=0D + Name(_CPC, Package()=0D + {=0D + NumEntries, // Integer=0D + Revision, // Integer=0D + HighestPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + NominalPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + LowestNonlinearPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + LowestPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + GuaranteedPerformanceRegister, // Buffer (Resource Descripto= r)=0D + DesiredPerformanceRegister , // Buffer (Resource Descripto= r)=0D + MinimumPerformanceRegister , // Buffer (Resource Descripto= r)=0D + MaximumPerformanceRegister , // Buffer (Resource Descripto= r)=0D + PerformanceReductionToleranceRegister, // Buffer (Resource Descripto= r)=0D + TimeWindowRegister, // Buffer (Resource Descripto= r)=0D + CounterWraparoundTime, // Integer or Buffer (Resourc= e Descriptor)=0D + ReferencePerformanceCounterRegister, // Buffer (Resource Descripto= r)=0D + DeliveredPerformanceCounterRegister, // Buffer (Resource Descripto= r)=0D + PerformanceLimitedRegister, // Buffer (Resource Descripto= r)=0D + CPPCEnableRegister // Buffer (Resource Descripto= r)=0D + AutonomousSelectionEnable, // Integer or Buffer (Resourc= e Descriptor)=0D + AutonomousActivityWindowRegister, // Buffer (Resource Descripto= r)=0D + EnergyPerformancePreferenceRegister, // Buffer (Resource Descripto= r)=0D + ReferencePerformance // Integer or Buffer (Resourc= e Descriptor)=0D + LowestFrequency, // Integer or Buffer (Resourc= e Descriptor)=0D + NominalFrequency // Integer or Buffer (Resourc= e Descriptor)=0D + })=0D +=0D + If resource buffer is NULL then integer will be used.=0D +=0D + Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)=0D +=0D + @ingroup CodeGenApis=0D +=0D + @param [in] HighestPerformanceBuffer If provided, buffer = that indicates the highest level=0D + of performance the p= rocessor.=0D + @param [in] HighestPerformanceInteger Indicates the highes= t level of performance the processor,=0D + used if buffer is NU= LL.=0D + @param [in] NominalPerformanceBuffer If provided buffer t= hat indicates the highest sustained=0D + performance level of= the processor.=0D + @param [in] NominalPerformanceInteger Indicates the highes= t sustained performance level=0D + of the processor, us= ed if buffer is NULL.=0D + @param [in] LowestNonlinearPerformanceBuffer If provided, buffer = that indicates the lowest performance level=0D + of the processor wit= h non-linear power savings.=0D + @param [in] LowestNonlinearPerformanceInteger Indicates the lowest= performance level of the processor with=0D + non-linear power sav= ings, used if buffer is NULL.=0D + @param [in] LowestPerformanceBuffer If provided, buffer = that indicates the=0D + lowest performance l= evel of the processor.=0D + @param [in] LowestPerformanceInteger Indicates the lowest= performance level of the processor,=0D + used if buffer is NU= LL.=0D + @param [in] GuaranteedPerformanceRegister If provided, Guarant= eed Performance Register Buffer.=0D + @param [in] DesiredPerformanceRegister If provided, Desired= Performance Register Buffer.=0D + @param [in] MinimumPerformanceRegister If provided, Minimum= Performance Register Buffer.=0D + @param [in] MaximumPerformanceRegister If provided, Maximum= Performance Register Buffer.=0D + @param [in] PerformanceReductionToleranceRegister If provided, Perform= ance Reduction Tolerance Register.=0D + @param [in] TimeWindowRegister If provided, Time Wi= ndow Register.=0D + @param [in] CounterWraparoundTimeBuffer If provided, Counter= Wraparound Time buffer.=0D + @param [in] CounterWraparoundTimeInteger Counter Wraparound T= ime, used if buffer is NULL.=0D + @param [in] ReferencePerformanceCounterRegister Reference Performanc= e Counter Register.=0D + @param [in] DeliveredPerformanceCounterRegister Delivered Performanc= e Counter Register.=0D + @param [in] PerformanceLimitedRegister Performance Limited = Register.=0D + @param [in] CPPCEnableRegister If provided, CPPC En= ableRegister.=0D + @param [in] AutonomousSelectionEnableBuffer If provided, Autonom= ous Selection Enable buffer.=0D + @param [in] AutonomousSelectionEnableInteger Autonomous Selection= Enable, used if buffer is NULL.=0D + @param [in] AutonomousActivityWindowRegister If provided, Autonom= ousActivity-WindowRegister.=0D + @param [in] EnergyPerformancePreferenceRegister If provided, EnergyP= erformance-PreferenceRegister.=0D + @param [in] ReferencePerformanceBuffer If provided, Referen= ce Performance buffer.=0D + @param [in] ReferencePerformanceInteger Reference Performanc= e, used if buffer is NULL.=0D + @param [in] LowestFrequencyBuffer If provided, Lowest = Frequency buffer.=0D + @param [in] LowestFrequencyInteger Lowest Frequency, us= ed if buffer is NULL.=0D + @param [in] NominalFrequencyBuffer If provided, Nominal= FrequencyBuffer buffer.=0D + @param [in] NominalFrequencyInteger NominalFrequencyBuff= er, used if buffer is NULL.=0D + @param [in] ParentNode If provided, set Par= entNode as the parent=0D + of the node created.= =0D + @param [out] NewCpcNode If success and provi= ded, contains the created node.=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +AmlCreateCpcNode (=0D + /// The revision number of the _CPC package format.=0D + IN UINT32 Revision,=0D + /// Indicates the highest level of performance the processor=0D + /// is theoretically capable of achieving.=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *HighestPerformanceBuffer OP= TIONAL,=0D + IN UINT32 HighestPerformanceInteger,=0D + /// Indicates the highest sustained performance level of the processor.= =0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalPerformanceBuffer OP= TIONAL,=0D + IN UINT32 NominalPerformanceInteger,=0D + /// Indicates the lowest performance level of the processor with non-lin= ear power savings.=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestNonlinearPerformanceB= uffer OPTIONAL,=0D + IN UINT32 LowestNonlinearPerformanceIn= teger,=0D + /// Indicates the lowest performance level of the processor..=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestPerformanceBuffer OPT= IONAL,=0D + IN UINT32 LowestPerformanceInteger,=0D + /// Guaranteed Performance Register Buffer.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *GuaranteedPerformanceRegist= er OPTIONAL,=0D + /// Desired Performance Register Buffer.=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DesiredPerformanceRegister,= =0D + /// Minimum Performance Register Buffer.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MinimumPerformanceRegister = OPTIONAL,=0D + /// Maximum Performance Register Buffer.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MaximumPerformanceRegister = OPTIONAL,=0D + /// Performance Reduction Tolerance Register.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceReductionToleran= ceRegister OPTIONAL,=0D + /// Time Window Register.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *TimeWindowRegister OPTIONAL= ,=0D + /// Counter Wraparound Time=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CounterWraparoundTimeBuffer= OPTIONAL,=0D + IN UINT32 CounterWraparoundTimeInteger= ,=0D + /// Reference Performance Counter Register=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceCounter= Register,=0D + /// Delivered Performance Counter Register=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DeliveredPerformanceCounter= Register,=0D + /// Performance Limited Register=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceLimitedRegister,= =0D + /// CPPC EnableRegister=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CPPCEnableRegister OPTIONAL= ,=0D + /// Autonomous Selection Enable=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousSelectionEnableBu= ffer OPTIONAL,=0D + IN UINT32 AutonomousSelectionEnableInt= eger,=0D + /// AutonomousActivity-WindowRegister=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousActivityWindowReg= ister OPTIONAL,=0D + /// EnergyPerformance-PreferenceRegister=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *EnergyPerformancePreference= Register OPTIONAL,=0D + /// Reference Performance=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceBuffer = OPTIONAL,=0D + IN UINT32 ReferencePerformanceInteger,= =0D + /// Lowest Frequency=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestFrequencyBuffer OPTIO= NAL,=0D + IN UINT32 LowestFrequencyInteger,=0D + /// Nominal Frequency=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalFrequencyBuffer OPTI= ONAL,=0D + IN UINT32 NominalFrequencyInteger,=0D + IN AML_NODE_HANDLE ParentNode OPTIONAL,=0D + OUT AML_OBJECT_NODE_HANDLE *NewCpcNode OPTIONAL=0D + );=0D +=0D // DEPRECATED APIS=0D #ifndef DISABLE_NEW_DEPRECATED_INTERFACES=0D =0D diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/= DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c=0D index 5fb39d077b..42f0d0002c 100644=0D --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c=0D +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c=0D @@ -2850,3 +2850,546 @@ error_handler:=0D =0D return Status;=0D }=0D +=0D +/** Adds a register to the package=0D +=0D + @ingroup CodeGenApis=0D +=0D + @param [in] Register If provided, register that will be added to pa= ckage.=0D + otherwise NULL register will be added=0D + @param [in] PackageNode Package to add value to=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +STATIC=0D +EFI_STATUS=0D +EFIAPI=0D +AmlAddRegisterToPackage (=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *Register OPTIONAL,=0D + IN AML_OBJECT_NODE_HANDLE PackageNode=0D + )=0D +{=0D + EFI_STATUS Status;=0D + AML_DATA_NODE_HANDLE RdNode;=0D + AML_OBJECT_NODE_HANDLE ResourceTemplateNode;=0D +=0D + RdNode =3D NULL;=0D +=0D + Status =3D AmlCodeGenResourceTemplate (&ResourceTemplateNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D +=0D + if (Register !=3D NULL) {=0D + Status =3D AmlCodeGenRdRegister (=0D + Register->AddressSpaceId,=0D + Register->RegisterBitWidth,=0D + Register->RegisterBitOffset,=0D + Register->Address,=0D + Register->AccessSize,=0D + NULL,=0D + &RdNode=0D + );=0D + } else {=0D + Status =3D AmlCodeGenRdRegister (=0D + EFI_ACPI_6_4_SYSTEM_MEMORY,=0D + 0,=0D + 0,=0D + 0,=0D + 0,=0D + NULL,=0D + &RdNode=0D + );=0D + }=0D +=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAppendRdNode (ResourceTemplateNode, RdNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + RdNode =3D NULL;=0D +=0D + Status =3D AmlVarListAddTail (=0D + (AML_NODE_HANDLE)PackageNode,=0D + (AML_NODE_HANDLE)ResourceTemplateNode=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + return Status;=0D +=0D +error_handler:=0D + if (RdNode !=3D NULL) {=0D + AmlDeleteTree ((AML_NODE_HANDLE)RdNode);=0D + }=0D +=0D + if (ResourceTemplateNode !=3D NULL) {=0D + AmlDeleteTree ((AML_NODE_HANDLE)ResourceTemplateNode);=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/** Adds an integer or register to the package=0D +=0D + @ingroup CodeGenApis=0D +=0D + @param [in] Register If provided, register that will be added to pa= ckage=0D + @param [in] Integer If Register is NULL, integer that will be adde= d to the package=0D + @param [in] PackageNode Package to add value to=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +STATIC=0D +EFI_STATUS=0D +EFIAPI=0D +AmlAddRegisterOrIntegerToPackage (=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *Register OPTIONAL,=0D + IN UINT32 Integer,=0D + IN AML_OBJECT_NODE_HANDLE PackageNode=0D + )=0D +{=0D + EFI_STATUS Status;=0D + AML_OBJECT_NODE_HANDLE IntegerNode;=0D +=0D + IntegerNode =3D NULL;=0D +=0D + if (Register !=3D NULL) {=0D + Status =3D AmlAddRegisterToPackage (Register, PackageNode);=0D + } else {=0D + Status =3D AmlCodeGenInteger (Integer, &IntegerNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D +=0D + Status =3D AmlVarListAddTail (=0D + (AML_NODE_HANDLE)PackageNode,=0D + (AML_NODE_HANDLE)IntegerNode=0D + );=0D + }=0D +=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + if (IntegerNode !=3D NULL) {=0D + AmlDeleteTree ((AML_NODE_HANDLE)IntegerNode);=0D + }=0D + }=0D +=0D + return Status;=0D +}=0D +=0D +/** Create a _CPC node.=0D +=0D + Creates and optionally adds the following node=0D + Name(_CPC, Package()=0D + {=0D + NumEntries, // Integer=0D + Revision, // Integer=0D + HighestPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + NominalPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + LowestNonlinearPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + LowestPerformance, // Integer or Buffer (Resourc= e Descriptor)=0D + GuaranteedPerformanceRegister, // Buffer (Resource Descripto= r)=0D + DesiredPerformanceRegister , // Buffer (Resource Descripto= r)=0D + MinimumPerformanceRegister , // Buffer (Resource Descripto= r)=0D + MaximumPerformanceRegister , // Buffer (Resource Descripto= r)=0D + PerformanceReductionToleranceRegister, // Buffer (Resource Descripto= r)=0D + TimeWindowRegister, // Buffer (Resource Descripto= r)=0D + CounterWraparoundTime, // Integer or Buffer (Resourc= e Descriptor)=0D + ReferencePerformanceCounterRegister, // Buffer (Resource Descripto= r)=0D + DeliveredPerformanceCounterRegister, // Buffer (Resource Descripto= r)=0D + PerformanceLimitedRegister, // Buffer (Resource Descripto= r)=0D + CPPCEnableRegister // Buffer (Resource Descripto= r)=0D + AutonomousSelectionEnable, // Integer or Buffer (Resourc= e Descriptor)=0D + AutonomousActivityWindowRegister, // Buffer (Resource Descripto= r)=0D + EnergyPerformancePreferenceRegister, // Buffer (Resource Descripto= r)=0D + ReferencePerformance // Integer or Buffer (Resourc= e Descriptor)=0D + LowestFrequency, // Integer or Buffer (Resourc= e Descriptor)=0D + NominalFrequency // Integer or Buffer (Resourc= e Descriptor)=0D + })=0D +=0D + If resource buffer is NULL then integer will be used.=0D +=0D + Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)=0D +=0D + @ingroup CodeGenApis=0D +=0D + @param [in] HighestPerformanceBuffer If provided, buffer = that indicates the highest level=0D + of performance the p= rocessor.=0D + @param [in] HighestPerformanceInteger Indicates the highes= t level of performance the processor,=0D + used if buffer is NU= LL.=0D + @param [in] NominalPerformanceBuffer If provided buffer t= hat indicates the highest sustained=0D + performance level of= the processor.=0D + @param [in] NominalPerformanceInteger Indicates the highes= t sustained performance level=0D + of the processor, us= ed if buffer is NULL.=0D + @param [in] LowestNonlinearPerformanceBuffer If provided, buffer = that indicates the lowest performance level=0D + of the processor wit= h non-linear power savings.=0D + @param [in] LowestNonlinearPerformanceInteger Indicates the lowest= performance level of the processor with=0D + non-linear power sav= ings, used if buffer is NULL.=0D + @param [in] LowestPerformanceBuffer If provided, buffer = that indicates the=0D + lowest performance l= evel of the processor.=0D + @param [in] LowestPerformanceInteger Indicates the lowest= performance level of the processor,=0D + used if buffer is NU= LL.=0D + @param [in] GuaranteedPerformanceRegister If provided, Guarant= eed Performance Register Buffer.=0D + @param [in] DesiredPerformanceRegister If provided, Desired= Performance Register Buffer.=0D + @param [in] MinimumPerformanceRegister If provided, Minimum= Performance Register Buffer.=0D + @param [in] MaximumPerformanceRegister If provided, Maximum= Performance Register Buffer.=0D + @param [in] PerformanceReductionToleranceRegister If provided, Perform= ance Reduction Tolerance Register.=0D + @param [in] TimeWindowRegister If provided, Time Wi= ndow Register.=0D + @param [in] CounterWraparoundTimeBuffer If provided, Counter= Wraparound Time buffer.=0D + @param [in] CounterWraparoundTimeInteger Counter Wraparound T= ime, used if buffer is NULL.=0D + @param [in] ReferencePerformanceCounterRegister Reference Performanc= e Counter Register.=0D + @param [in] DeliveredPerformanceCounterRegister Delivered Performanc= e Counter Register.=0D + @param [in] PerformanceLimitedRegister Performance Limited = Register.=0D + @param [in] CPPCEnableRegister If provided, CPPC En= ableRegister.=0D + @param [in] AutonomousSelectionEnableBuffer If provided, Autonom= ous Selection Enable buffer.=0D + @param [in] AutonomousSelectionEnableInteger Autonomous Selection= Enable, used if buffer is NULL.=0D + @param [in] AutonomousActivityWindowRegister If provided, Autonom= ousActivity-WindowRegister.=0D + @param [in] EnergyPerformancePreferenceRegister If provided, EnergyP= erformance-PreferenceRegister.=0D + @param [in] ReferencePerformanceBuffer If provided, Referen= ce Performance buffer.=0D + @param [in] ReferencePerformanceInteger Reference Performanc= e, used if buffer is NULL.=0D + @param [in] LowestFrequencyBuffer If provided, Lowest = Frequency buffer.=0D + @param [in] LowestFrequencyInteger Lowest Frequency, us= ed if buffer is NULL.=0D + @param [in] NominalFrequencyBuffer If provided, Nominal= FrequencyBuffer buffer.=0D + @param [in] NominalFrequencyInteger NominalFrequencyBuff= er, used if buffer is NULL.=0D + @param [in] ParentNode If provided, set Par= entNode as the parent=0D + of the node created.= =0D + @param [out] NewCpcNode If success and provi= ded, contains the created node.=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +AmlCreateCpcNode (=0D + /// The revision number of the _CPC package format.=0D + IN UINT32 Revision,=0D + /// Indicates the highest level of performance the processor=0D + /// is theoretically capable of achieving.=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *HighestPerformanceBuffer OPT= IONAL,=0D + IN UINT32 HighestPerformanceInteger,=0D + /// Indicates the highest sustained performance level of the processor.= =0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalPerformanceBuffer OPT= IONAL,=0D + IN UINT32 NominalPerformanceInteger,=0D + /// Indicates the lowest performance level of the processor with non-lin= ear power savings.=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestNonlinearPerformanceBu= ffer OPTIONAL,=0D + IN UINT32 LowestNonlinearPerformanceInt= eger,=0D + /// Indicates the lowest performance level of the processor..=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestPerformanceBuffer OPTI= ONAL,=0D + IN UINT32 LowestPerformanceInteger,=0D + /// Guaranteed Performance Register Buffer.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *GuaranteedPerformanceRegiste= r OPTIONAL,=0D + /// Desired Performance Register Buffer.=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DesiredPerformanceRegister,= =0D + /// Minimum Performance Register Buffer.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MinimumPerformanceRegister O= PTIONAL,=0D + /// Maximum Performance Register Buffer.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *MaximumPerformanceRegister O= PTIONAL,=0D + /// Performance Reduction Tolerance Register.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceReductionToleranc= eRegister OPTIONAL,=0D + /// Time Window Register.=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *TimeWindowRegister OPTIONAL,= =0D + /// Counter Wraparound Time=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CounterWraparoundTimeBuffer = OPTIONAL,=0D + IN UINT32 CounterWraparoundTimeInteger,= =0D + /// Reference Performance Counter Register=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceCounterR= egister,=0D + /// Delivered Performance Counter Register=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *DeliveredPerformanceCounterR= egister,=0D + /// Performance Limited Register=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *PerformanceLimitedRegister,= =0D + /// CPPC EnableRegister=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *CPPCEnableRegister OPTIONAL,= =0D + /// Autonomous Selection Enable=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousSelectionEnableBuf= fer OPTIONAL,=0D + IN UINT32 AutonomousSelectionEnableInte= ger,=0D + /// AutonomousActivity-WindowRegister=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *AutonomousActivityWindowRegi= ster OPTIONAL,=0D + /// EnergyPerformance-PreferenceRegister=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *EnergyPerformancePreferenceR= egister OPTIONAL,=0D + /// Reference Performance=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *ReferencePerformanceBuffer O= PTIONAL,=0D + IN UINT32 ReferencePerformanceInteger,= =0D + /// Lowest Frequency=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *LowestFrequencyBuffer OPTION= AL,=0D + IN UINT32 LowestFrequencyInteger,=0D + /// Nominal Frequency=0D + /// Optional=0D + IN EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE *NominalFrequencyBuffer OPTIO= NAL,=0D + IN UINT32 NominalFrequencyInteger,=0D + IN AML_NODE_HANDLE ParentNode OPTIONAL,=0D + OUT AML_OBJECT_NODE_HANDLE *NewCpcNode OPTIONAL=0D + )=0D +{=0D + EFI_STATUS Status;=0D + AML_OBJECT_NODE_HANDLE CpcNode;=0D + AML_OBJECT_NODE_HANDLE CpcPackage;=0D + UINT32 NumberOfEntries;=0D +=0D + // Revision 3 per ACPI 6.4 specification=0D + if (Revision =3D=3D 3) {=0D + // NumEntries 23 per ACPI 6.4 specification=0D + NumberOfEntries =3D 23;=0D + } else {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + if (((HighestPerformanceBuffer =3D=3D NULL) && (HighestPerformanceIntege= r =3D=3D 0)) ||=0D + ((NominalPerformanceBuffer =3D=3D NULL) && (NominalPerformanceIntege= r =3D=3D 0)) ||=0D + ((LowestNonlinearPerformanceBuffer =3D=3D NULL) && (LowestNonlinearP= erformanceInteger =3D=3D 0)) ||=0D + ((LowestPerformanceBuffer =3D=3D NULL) && (LowestPerformanceInteger = =3D=3D 0)) ||=0D + (DesiredPerformanceRegister =3D=3D NULL) ||=0D + (ReferencePerformanceCounterRegister =3D=3D NULL) ||=0D + (DeliveredPerformanceCounterRegister =3D=3D NULL) ||=0D + (PerformanceLimitedRegister =3D=3D NULL) ||=0D + ((ParentNode =3D=3D NULL) && (NewCpcNode =3D=3D NULL)))=0D + {=0D + ASSERT (0);=0D + return EFI_INVALID_PARAMETER;=0D + }=0D +=0D + CpcPackage =3D NULL;=0D +=0D + Status =3D AmlCodeGenNamePackage ("_CPC", NULL, &CpcNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D +=0D + // Get the Package object node of the _CPC node,=0D + // which is the 2nd fixed argument (i.e. index 1).=0D + CpcPackage =3D (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (=0D + CpcNode,=0D + EAmlParseIndexTerm1=0D + );=0D + if ((CpcPackage =3D=3D NULL) = ||=0D + (AmlGetNodeType ((AML_NODE_HANDLE)CpcPackage) !=3D EAmlNodeObject) = ||=0D + (!AmlNodeHasOpCode (CpcPackage, AML_PACKAGE_OP, 0)))=0D + {=0D + ASSERT (0);=0D + Status =3D EFI_INVALID_PARAMETER;=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + NULL,=0D + NumberOfEntries,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + NULL,=0D + Revision,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + HighestPerformanceBuffer,=0D + HighestPerformanceInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + NominalPerformanceBuffer,=0D + NominalPerformanceInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + LowestNonlinearPerformanceBuffer,=0D + LowestNonlinearPerformanceInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + LowestPerformanceBuffer,=0D + LowestPerformanceInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (GuaranteedPerformanceRegister, CpcPa= ckage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (DesiredPerformanceRegister, CpcPacka= ge);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (MinimumPerformanceRegister, CpcPacka= ge);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (MaximumPerformanceRegister, CpcPacka= ge);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (PerformanceReductionToleranceRegiste= r, CpcPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (TimeWindowRegister, CpcPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + CounterWraparoundTimeBuffer,=0D + CounterWraparoundTimeInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (ReferencePerformanceCounterRegister,= CpcPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (DeliveredPerformanceCounterRegister,= CpcPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (PerformanceLimitedRegister, CpcPacka= ge);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (CPPCEnableRegister, CpcPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + AutonomousSelectionEnableBuffer,=0D + AutonomousSelectionEnableInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (AutonomousActivityWindowRegister, Cp= cPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterToPackage (EnergyPerformancePreferenceRegister,= CpcPackage);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + ReferencePerformanceBuffer,=0D + ReferencePerformanceInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + LowestFrequencyBuffer,=0D + LowestFrequencyInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D AmlAddRegisterOrIntegerToPackage (=0D + NominalFrequencyBuffer,=0D + NominalFrequencyInteger,=0D + CpcPackage=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + Status =3D LinkNode (CpcNode, ParentNode, NewCpcNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + goto error_handler;=0D + }=0D +=0D + return Status;=0D +=0D +error_handler:=0D + AmlDeleteTree ((AML_NODE_HANDLE)CpcNode);=0D + return Status;=0D +}=0D -- =0D 2.25.1=0D =0D