qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 1/5] sysemu/cpu-timers: Introduce ICountMode enumerator


From: Richard Henderson
Subject: Re: [PATCH v2 1/5] sysemu/cpu-timers: Introduce ICountMode enumerator
Date: Thu, 7 Dec 2023 14:06:15 -0800
User-agent: Mozilla Thunderbird

On 12/7/23 07:45, 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 2e786fe7fb..e909ffae47 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 = 1,
+    ICOUNT_ADAPTATIVE = 2,

No need for the assignments.  Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

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