[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/11] timer: add cpu_icount_to_ns function.
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/11] timer: add cpu_icount_to_ns function. |
Date: |
Wed, 6 Aug 2014 18:12:28 +0200 |
From: KONRAD Frederic <address@hidden>
This adds cpu_icount_to_ns function which is needed for reverse execution.
It returns the time for a specific instruction.
Signed-off-by: KONRAD Frederic <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpus.c | 7 ++++++-
include/qemu/timer.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index a6b6557..62636a6 100644
--- a/cpus.c
+++ b/cpus.c
@@ -146,7 +146,7 @@ static int64_t cpu_get_icount_locked(void)
}
icount -= (cpu->icount_decr.u16.low + cpu->icount_extra);
}
- return timers_state.qemu_icount_bias + (icount << icount_time_shift);
+ return timers_state.qemu_icount_bias + cpu_icount_to_ns(icount);
}
int64_t cpu_get_icount(void)
@@ -162,6 +162,11 @@ int64_t cpu_get_icount(void)
return icount;
}
+int64_t cpu_icount_to_ns(int64_t icount)
+{
+ return icount << icount_time_shift;
+}
+
/* return the host CPU cycle counter and handle stop/restart */
/* Caller must hold the BQL */
int64_t cpu_get_ticks(void)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 7f9a074..e12c714 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -745,6 +745,7 @@ static inline int64_t get_clock(void)
/* icount */
int64_t cpu_get_icount(void);
int64_t cpu_get_clock(void);
+int64_t cpu_icount_to_ns(int64_t icount);
/*******************************************/
/* host CPU ticks (if available) */
--
1.9.3
- [Qemu-devel] [PULL 00/11] KVM, icount changes for 2014-08-06, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 02/11] icount: put icount variables into TimerState., Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 03/11] migration: migrate icount fields., Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 04/11] timer: add cpu_icount_to_ns function.,
Paolo Bonzini <=
- [Qemu-devel] [PULL 01/11] backends: Introduce chr-testdev, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 05/11] icount: Fix virtual clock start value on ARM, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 06/11] icount: Add QemuOpts for icount, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 07/11] icount: Add align option to icount, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 08/11] cpu-exec: Add sleeping algorithm, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 09/11] cpu-exec: Print to console if the guest is late, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 11/11] target-mips: Ignore unassigned accesses with KVM, Paolo Bonzini, 2014/08/06
- [Qemu-devel] [PULL 10/11] monitor: Add drift info to 'info jit', Paolo Bonzini, 2014/08/06
- Re: [Qemu-devel] [PULL 00/11] KVM, icount changes for 2014-08-06, Peter Maydell, 2014/08/07