Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133091857
D1430.id2983.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D1430.id2983.diff
View Options
Index: sys/x86/include/pvclock.h
===================================================================
--- sys/x86/include/pvclock.h
+++ sys/x86/include/pvclock.h
@@ -50,6 +50,7 @@
} __packed;
void pvclock_resume(void);
+uint64_t pvclock_tsc_freq(struct pvclock_vcpu_time_info *ti);
uint64_t pvclock_get_timecount(struct pvclock_vcpu_time_info *ti);
void pvclock_get_wallclock(struct pvclock_wall_clock *wc,
struct timespec *ts);
Index: sys/x86/x86/pvclock.c
===================================================================
--- sys/x86/x86/pvclock.c
+++ sys/x86/x86/pvclock.c
@@ -51,6 +51,21 @@
atomic_store_rel_64(&pvclock_last_cycles, 0);
}
+uint64_t
+pvclock_tsc_freq(struct pvclock_vcpu_time_info *ti)
+{
+ uint64_t freq;
+
+ freq = (1000000000ULL << 32) / ti->tsc_to_system_mul;
+
+ if (ti->tsc_shift < 0)
+ freq <<= -ti->tsc_shift;
+ else
+ freq >>= ti->tsc_shift;
+
+ return (freq);
+}
+
/*
* Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
* yielding a 64-bit result.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 23, 9:52 PM (13 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24104738
Default Alt Text
D1430.id2983.diff (1 KB)
Attached To
Mode
D1430: paravirt: Add interface to calculate the TSC frequency from pvclock
Attached
Detach File
Event Timeline
Log In to Comment