add teest tsc sync
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 19 Mar 2007 03:56:23 +0000 (03:56 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 19 Mar 2007 03:56:23 +0000 (03:56 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2438 04897980-b3bd-0310-b5e0-8ef037075253

tests/kernel/test-hpet.c [new file with mode: 0644]

diff --git a/tests/kernel/test-hpet.c b/tests/kernel/test-hpet.c
new file mode 100644 (file)
index 0000000..bf0dda5
--- /dev/null
@@ -0,0 +1,40 @@
+/* test-async-tsc.c
+ *
+ * test async tsc on AMD.
+ */
+
+
+#include <asm/atomic.h>
+#include <linux/module.h>
+#include <asm/timex.h>
+#include <asm/hpet.h>
+#include <asm/io.h>
+
+static int __init test_init(void)
+{
+       int i;
+       cycles_t time1, time2;
+       volatile unsigned long myval;
+
+       time1 = get_cycles();
+       for (i=0; i<1; i++) {
+               //printk("time %llu\n", ltt_tsc_read());
+               //myval = ltt_tsc_read();
+               myval = hpet_readl(HPET_COUNTER);
+       }
+       time2 = get_cycles();
+       printk("timediff %llu\n", time2-time1);
+       return -EPERM;
+}
+
+static void __exit test_exit(void)
+{
+}
+
+module_init(test_init);
+module_exit(test_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("sync async tsc");
+
This page took 0.025041 seconds and 4 git commands to generate.