public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Michael Kinney <michael.d.kinney@intel.com>,
	Ruiyu Ni <ruiyu.ni@intel.com>
Subject: [Patch 3/4] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant definition.
Date: Thu, 24 Aug 2017 11:03:26 +0800	[thread overview]
Message-ID: <1503543807-6304-4-git-send-email-eric.dong@intel.com> (raw)
In-Reply-To: <1503543807-6304-1-git-send-email-eric.dong@intel.com>

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 <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c b/UefiCpuPkg/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 = 0,
-  OutputSchemeToPA,
-  OutputSchemeInvalid
-} PROC_TRACE_OUTPUT_SCHEME;
+  RtitOutputSchemeSingleRange = 0,
+  RtitOutputSchemeToPA
+} RTIT_OUTPUT_SCHEME;
 
 typedef struct  {
   BOOLEAN  ProcTraceSupported;
@@ -122,7 +121,7 @@ ProcTraceSupport (
   //
   ProcTraceData = (PROC_TRACE_DATA *) ConfigData;
   if ((ProcTraceData->ProcTraceMemSize > RtitTopaMemorySize128M) ||
-      (ProcTraceData->ProcTraceOutputScheme > ProcTraceOutputSchemeToPA)) {
+      (ProcTraceData->ProcTraceOutputScheme > RtitOutputSchemeToPA)) {
     return FALSE;
   }
 
@@ -138,8 +137,8 @@ ProcTraceSupport (
   AsmCpuidEx (CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF, NULL, NULL, &Ecx.Uint32, NULL);
   ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported = (BOOLEAN) (Ecx.Bits.RTIT == 1);
   ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported = (BOOLEAN) (Ecx.Bits.SingleRangeOutput == 1);
-  if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported || 
-      ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported) {
+  if ((ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported && (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeToPA)) ||
+      (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported && (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeSingleRange))) {
     return TRUE;
   }
 
@@ -291,7 +290,7 @@ ProcTraceInitialize (
   //  Single Range output scheme
   //
   if (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported && 
-      (ProcTraceData->ProcTraceOutputScheme == OutputSchemeSingleRange)) {
+      (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeSingleRange)) {
     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 && 
-      (ProcTraceData->ProcTraceOutputScheme == OutputSchemeToPA)) {
+      (ProcTraceData->ProcTraceOutputScheme == RtitOutputSchemeToPA)) {
     //
     //  Create ToPA structure aligned at 4KB for each logical thread
     //  with at least 2 entries by 8 bytes size each. The first entry
-- 
2.7.0.windows.1



  parent reply	other threads:[~2017-08-24  3:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  3:03 [Patch 0/4] Enhance the implementation for Proc Trace feature Eric Dong
2017-08-24  3:03 ` [Patch 1/4] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA table entry definition Eric Dong
2017-08-24  3:03 ` [Patch 2/4] UefiCpuPkg/CpuCommonFeaturesLib: Use MSR data structure when change MSR value Eric Dong
2017-08-24  3:03 ` Eric Dong [this message]
2017-08-24  3:03 ` [Patch 4/4] UefiCpuPkg: Update default for PcdCpuProcTraceMemSize/PcdCpuProcTraceOutputScheme Eric Dong
2017-08-25  0:31 ` [Patch 0/4] Enhance the implementation for Proc Trace feature Kinney, Michael D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503543807-6304-4-git-send-email-eric.dong@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox