[PATCH v2 04/11] TSC: write cycles stamp value to input pointer

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

 



This allows to get cycles stamp used for time calculation when
clocksource is tsc

Signed-off-by: Denis Plotnikov <dplotnikov@xxxxxxxxxxxxx>
---
 arch/x86/kernel/tsc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index b475f6c..5411b18 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1112,7 +1112,11 @@ static void tsc_resume(struct clocksource *cs)
  */
 static u64 read_tsc(struct clocksource *cs, u64 *cycles_stamp)
 {
-	return (u64)rdtsc_ordered();
+	u64 tsc = rdtsc_ordered();
+
+	if (cycles_stamp)
+		*cycles_stamp = tsc;
+	return tsc;
 }
 
 static void tsc_cs_mark_unstable(struct clocksource *cs)
-- 
2.7.4




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux