From nobody Fri Dec 27 04:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1503543826144761.598212697832; Wed, 23 Aug 2017 20:03:46 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BAAEC21D2E648; Wed, 23 Aug 2017 20:01:05 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CC30221D2E635 for ; Wed, 23 Aug 2017 20:01:01 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 20:03:36 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga002.jf.intel.com with ESMTP; 23 Aug 2017 20:03:34 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="127637283" From: Eric Dong To: edk2-devel@lists.01.org Date: Thu, 24 Aug 2017 11:03:26 +0800 Message-Id: <1503543807-6304-4-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1503543807-6304-1-git-send-email-eric.dong@intel.com> References: <1503543807-6304-1-git-send-email-eric.dong@intel.com> Subject: [edk2] [Patch 3/4] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant definition. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Kinney , Ruiyu Ni MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The EnumProcTraceMemDisable/OutputSchemeInvalid are redundant definitions. These definitions can be handled by other code, so remove them. V2: Change enum members name. Cc: Michael Kinney Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c b/UefiCpuP= kg/Library/CpuCommonFeaturesLib/ProcTrace.c index e4636b2..167c1be 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c @@ -30,10 +30,9 @@ /// Processor trace output scheme selection. /// typedef enum { - OutputSchemeSingleRange =3D 0, - OutputSchemeToPA, - OutputSchemeInvalid -} PROC_TRACE_OUTPUT_SCHEME; + RtitOutputSchemeSingleRange =3D 0, + RtitOutputSchemeToPA +} RTIT_OUTPUT_SCHEME; =20 typedef struct { BOOLEAN ProcTraceSupported; @@ -122,7 +121,7 @@ ProcTraceSupport ( // ProcTraceData =3D (PROC_TRACE_DATA *) ConfigData; if ((ProcTraceData->ProcTraceMemSize > RtitTopaMemorySize128M) || - (ProcTraceData->ProcTraceOutputScheme > ProcTraceOutputSchemeToPA)) { + (ProcTraceData->ProcTraceOutputScheme > RtitOutputSchemeToPA)) { return FALSE; } =20 @@ -138,8 +137,8 @@ ProcTraceSupport ( AsmCpuidEx (CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAI= N_LEAF, NULL, NULL, &Ecx.Uint32, NULL); ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported =3D (BOOLEAN= ) (Ecx.Bits.RTIT =3D=3D 1); ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported =3D (= BOOLEAN) (Ecx.Bits.SingleRangeOutput =3D=3D 1); - if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported ||=20 - ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported) { + if ((ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported && (Pro= cTraceData->ProcTraceOutputScheme =3D=3D RtitOutputSchemeToPA)) || + (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported = && (ProcTraceData->ProcTraceOutputScheme =3D=3D RtitOutputSchemeSingleRange= ))) { return TRUE; } =20 @@ -291,7 +290,7 @@ ProcTraceInitialize ( // Single Range output scheme // if (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported &= &=20 - (ProcTraceData->ProcTraceOutputScheme =3D=3D OutputSchemeSingleRange= )) { + (ProcTraceData->ProcTraceOutputScheme =3D=3D RtitOutputSchemeSingleR= ange)) { if (FirstIn) { DEBUG ((DEBUG_INFO, "ProcTrace: Enabling Single Range Output scheme = \n")); } @@ -337,7 +336,7 @@ ProcTraceInitialize ( // ToPA(Table of physical address) scheme // if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported &&=20 - (ProcTraceData->ProcTraceOutputScheme =3D=3D OutputSchemeToPA)) { + (ProcTraceData->ProcTraceOutputScheme =3D=3D RtitOutputSchemeToPA)) { // // Create ToPA structure aligned at 4KB for each logical thread // with at least 2 entries by 8 bytes size each. The first entry --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel