public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>
To: devel@edk2.groups.io
Cc: Sami Mujawar <sami.mujawar@arm.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: [PATCH v2 4/8] ArmPkg: skip empty system registers in ArmCpuInfo
Date: Mon,  5 Jun 2023 08:37:39 +0200	[thread overview]
Message-ID: <20230605063743.405487-6-marcin.juszkiewicz@linaro.org> (raw)
In-Reply-To: <20230605063743.405487-1-marcin.juszkiewicz@linaro.org>

If system register is empty (value == 0) then do not display information
from it.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.c | 35 +++++++++++++++-------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.c b/ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.c
index 982714ef6ca0..9d0d164774ff 100644
--- a/ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.c
+++ b/ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.c
@@ -2407,23 +2407,38 @@ UefiMain (
 
   HandleAa64Mmfr0 (Aa64Mmfr0);
   PrintSpacer ();
-  HandleAa64Mmfr1 (Aa64Mmfr1, Aa64Pfr0);
-  PrintSpacer ();
-  HandleAa64Mmfr2 (Aa64Mmfr2);
 
-  PrintSpacer ();
+  if (Aa64Mmfr1) {
+    HandleAa64Mmfr1 (Aa64Mmfr1, Aa64Pfr0);
+    PrintSpacer ();
+  }
+
+  if (Aa64Mmfr2) {
+    HandleAa64Mmfr2 (Aa64Mmfr2);
+    PrintSpacer ();
+  }
+
   HandleAa64Pfr0 (Aa64Pfr0, Aa64Pfr1);
   PrintSpacer ();
-  HandleAa64Pfr1 (Aa64Pfr1);
 
-  PrintSpacer ();
+  if (Aa64Pfr1) {
+    HandleAa64Pfr1 (Aa64Pfr1);
+    PrintSpacer ();
+  }
+
   HandleAa64Isar0 (Aa64Isar0);
   PrintSpacer ();
-  HandleAa64Isar1 (Aa64Isar1);
-  PrintSpacer ();
-  HandleAa64Isar2 (Aa64Isar2);
 
-  PrintSpacer ();
+  if (Aa64Isar1) {
+    HandleAa64Isar1 (Aa64Isar1);
+    PrintSpacer ();
+  }
+
+  if (Aa64Isar2) {
+    HandleAa64Isar2 (Aa64Isar2);
+    PrintSpacer ();
+  }
+
   HandleAa64Dfr0 (Aa64Dfr0);
 
   return EFI_SUCCESS;
-- 
2.40.1


  parent reply	other threads:[~2023-06-05  6:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  6:37 [PATCH v2 0/8] ArmCpuInfo improvements Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 1/1] ArmPkg: add SMC defines for SiP service calls Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 1/8] ArmPkg: fix reading of first nibbles in ArmCpuInfo Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 2/8] ArmPkg: shorten register field " Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 3/8] ArmPkg: add functions to read SVE/SME info Marcin Juszkiewicz
2023-06-05  6:37 ` Marcin Juszkiewicz [this message]
2023-06-05  6:37 ` [PATCH v2 5/8] ArmPkg: format output in one place in ArmCpuInfo Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 6/8] ArmPkg: handle SVE/SME " Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 7/8] ArmPkg: cleaning output of ArmCpuInfo Marcin Juszkiewicz
2023-06-05  6:37 ` [PATCH v2 8/8] ArmPkg: show stage2 granule support on Neoverse-N1 Marcin Juszkiewicz

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=20230605063743.405487-6-marcin.juszkiewicz@linaro.org \
    --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