| 1 | /* test-async-tsc.c |
| 2 | * |
| 3 | * test async tsc on AMD. |
| 4 | */ |
| 5 | |
| 6 | |
| 7 | #include <asm/atomic.h> |
| 8 | #include <linux/module.h> |
| 9 | #include <asm/timex.h> |
| 10 | #include <asm/hpet.h> |
| 11 | #include <asm/io.h> |
| 12 | |
| 13 | static int __init test_init(void) |
| 14 | { |
| 15 | int i; |
| 16 | cycles_t time1, time2; |
| 17 | volatile unsigned long myval; |
| 18 | |
| 19 | time1 = get_cycles(); |
| 20 | for (i=0; i<1; i++) { |
| 21 | //printk("time %llu\n", ltt_tsc_read()); |
| 22 | //myval = ltt_tsc_read(); |
| 23 | myval = hpet_readl(HPET_COUNTER); |
| 24 | } |
| 25 | time2 = get_cycles(); |
| 26 | printk("timediff %llu\n", time2-time1); |
| 27 | return -EPERM; |
| 28 | } |
| 29 | |
| 30 | static void __exit test_exit(void) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | module_init(test_init); |
| 35 | module_exit(test_exit); |
| 36 | |
| 37 | MODULE_LICENSE("GPL"); |
| 38 | MODULE_AUTHOR("Mathieu Desnoyers"); |
| 39 | MODULE_DESCRIPTION("sync async tsc"); |
| 40 | |