qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v3 3/6] sysemu/cpu-timers: Introduce ICountMode enumerator


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 3/6] sysemu/cpu-timers: Introduce ICountMode enumerator
Date: Fri, 8 Dec 2023 14:05:19 +0100
User-agent: Mozilla Thunderbird

On 8/12/23 12:35, Philippe Mathieu-Daudé wrote:
Rather than having to lookup for what the 0, 1, 2, ...
icount values are, use a enum definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  include/sysemu/cpu-timers.h | 20 +++++++++++++-------
  accel/tcg/icount-common.c   | 16 +++++++---------
  stubs/icount.c              |  2 +-
  system/cpu-timers.c         |  2 +-
  target/arm/helper.c         |  3 ++-
  5 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/include/sysemu/cpu-timers.h b/include/sysemu/cpu-timers.h
index b70dc7692d..3f05f29b10 100644
--- a/include/sysemu/cpu-timers.h
+++ b/include/sysemu/cpu-timers.h
@@ -17,18 +17,24 @@ void cpu_timers_init(void);
/* icount - Instruction Counter API */ -/*
- * icount enablement state:
+/**
+ * ICountMode: icount enablement state:
   *
- * 0 = Disabled - Do not count executed instructions.
- * 1 = Enabled - Fixed conversion of insn to ns via "shift" option
- * 2 = Enabled - Runtime adaptive algorithm to compute shift
+ * @ICOUNT_DISABLED: Disabled - Do not count executed instructions.
+ * @ICOUNT_PRECISE: Enabled - Fixed conversion of insn to ns via "shift" option
+ * @ICOUNT_ADAPTATIVE: Enabled - Runtime adaptive algorithm to compute shift
   */
+typedef enum {
+    ICOUNT_DISABLED = 0,
+    ICOUNT_PRECISE,
+    ICOUNT_ADAPTATIVE,
+} ICountMode;

Per v2:
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



reply via email to

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