3 * test async tsc on AMD.
7 #include <asm/atomic.h>
8 #include <linux/module.h>
12 #include <linux/clocksource.h>
13 #include <linux/ltt.h>
14 #include <asm/cacheflush.h>
16 //#define NR_LOOPS 10000
19 extern cycle_t
read_hpet(void);
21 static int __init
test_init(void)
24 cycles_t time1
, time2
;
25 volatile unsigned long myval
;
26 int sync_save
; /* racy */
28 sync_save
= ltt_tsc_is_sync
;
30 //ltt_tsc_is_sync = 1;
31 return -EPERM
; //TEST !
32 myval
= ltt_get_timestamp64();
34 for (i
=0; i
< NR_LOOPS
; i
++) {
35 //printk("time %llu\n", ltt_tsc_read());
36 //get_cycles_barrier();
37 //myval = get_cycles();
38 //get_cycles_barrier();
40 //clflush(<t_last_tsc);
41 //myval = ltt_get_timestamp64();
42 printk("val : %llu\n", (unsigned long long)myval
);
45 printk("timediff %llu\n", (time2
-time1
)/NR_LOOPS
);
46 ltt_tsc_is_sync
= sync_save
;
50 static void __exit
test_exit(void)
54 module_init(test_init
);
55 module_exit(test_exit
);
57 MODULE_LICENSE("GPL");
58 MODULE_AUTHOR("Mathieu Desnoyers");
59 MODULE_DESCRIPTION("sync async tsc");
This page took 0.029819 seconds and 4 git commands to generate.