]> git.sur5r.net Git - u-boot/blobdiff - arch/x86/lib/timer.c
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[u-boot] / arch / x86 / lib / timer.c
index fd7032e92c9f40e007348aac3a249e5078284b82..1f8ce609e2e4b402b4660619d179c4cc516015cb 100644 (file)
@@ -98,3 +98,19 @@ ulong get_timer(ulong base)
 {
        return system_ticks - base;
 }
+
+void timer_set_tsc_base(uint64_t new_base)
+{
+       gd->arch.tsc_base = new_base;
+}
+
+uint64_t timer_get_tsc(void)
+{
+       uint64_t time_now;
+
+       time_now = rdtsc();
+       if (!gd->arch.tsc_base)
+               gd->arch.tsc_base = time_now;
+
+       return time_now - gd->arch.tsc_base;
+}