qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/8] target/arm: use FIELD macro for CNTHCTL bit definitions


From: Richard Henderson
Subject: Re: [PATCH 3/8] target/arm: use FIELD macro for CNTHCTL bit definitions
Date: Fri, 1 Mar 2024 11:19:26 -1000
User-agent: Mozilla Thunderbird

On 3/1/24 08:32, Peter Maydell wrote:
We prefer the FIELD macro over ad-hoc #defines for register bits;
switch CNTHCTL to that style before we add any more bits.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  target/arm/internals.h | 19 +++++++++++++++++--
  target/arm/helper.c    |  9 ++++-----
  2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/target/arm/internals.h b/target/arm/internals.h
index c93acb270cc..6553e414934 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -224,8 +224,23 @@ FIELD(VTCR, SL2, 33, 1)
  #define HSTR_TTEE (1 << 16)
  #define HSTR_TJDBX (1 << 17)
-#define CNTHCTL_CNTVMASK (1 << 18)
-#define CNTHCTL_CNTPMASK      (1 << 19)
+FIELD(CNTHCTL, EL0PCTEN, 0, 1)
+FIELD(CNTHCTL, EL0VCTEN, 1, 1)
+FIELD(CNTHCTL, EVNTEN, 2, 1)
+FIELD(CNTHCTL, EVNTDIR, 3, 1)
...
+FIELD(CNTHCTL, EL0VTEN, 8, 1)
+FIELD(CNTHCTL, EL0PTEN, 9, 1)
+FIELD(CNTHCTL, EL1PCTEN, 10, 1)
+FIELD(CNTHCTL, EL1PTEN, 11, 1)

These bits change definition based on HCR_E2H, which I remembered when I got to patch 5, which adds code nearby the existing tests of these bits.

It might be confusing to only provide the E2H versions, without some extra 
suffix?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]