qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH target-arm v4 4/7] target-arm: Add arm_ccnt_enabled


From: Peter Crosthwaite
Subject: [Qemu-devel] [PATCH target-arm v4 4/7] target-arm: Add arm_ccnt_enabled function
Date: Mon, 25 Aug 2014 21:11:27 -0700

From: Alistair Francis <address@hidden>

Include a helper function to determine if the CCNT counter
is enabled.

Signed-off-by: Alistair Francis <address@hidden>
[ PC changes
  * Remove EL based checks
]
Signed-off-by: Peter Crosthwaite <address@hidden>
---
Changed since v3
Remove checks based on EL.
Changed since v2 (PMM review):
Blank line for readability
Use switch instead of cascading ifs.
Use true and false.
Drop extraneous #endif #if

 target-arm/helper.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index 13507f7..e6c82ab 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -548,6 +548,18 @@ static CPAccessResult pmreg_access(CPUARMState *env, const 
ARMCPRegInfo *ri)
 }
 
 #ifndef CONFIG_USER_ONLY
+
+static inline bool arm_ccnt_enabled(CPUARMState *env)
+{
+    /* This does not support checking PMCCFILTR_EL0 register */
+
+    if (!(env->cp15.c9_pmcr & PMCRE)) {
+        return false;
+    }
+
+    return true;
+}
+
 static void pmcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
                        uint64_t value)
 {
-- 
2.1.0.1.g27b9230




reply via email to

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