From 7a1f4969ca9ef010f6861eb806cfc10929a70146 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 18 Aug 2004 23:12:16 -0400 Subject: added nate's memtest code to devtime util/ccdrv/devtime.c: incorperated nate's changes for memory testing. --HG-- extra : convert_revision : 6c479dd6b9a79659bb4cfd3e03b794909b14db3b --- util/ccdrv/devtime.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'util/ccdrv/devtime.c') diff --git a/util/ccdrv/devtime.c b/util/ccdrv/devtime.c index e487f2fe7..62b0e2592 100644 --- a/util/ccdrv/devtime.c +++ b/util/ccdrv/devtime.c @@ -48,6 +48,9 @@ static char *dataAddr = NULL; static int count = 0; +#ifdef __alpha__ +static int memTest = 0; +#endif static inline uint32_t cycleCounter(uint32_t dep); @@ -63,6 +66,31 @@ static int __init devtime_start(void) printk("Devtime Driver Version %s Loaded...\n", DRIVER_VER); +#ifdef __alpha__ + if (memTest) { + addr = 0xfffffc0000000000; +// addr += 16*1024*1024; + + printk("Preparing memory test.\n"); + + t1 = cycleCounter(trash); + for (x = 0; x < count; x++) { + trash = readl(addr); + t2 = cycleCounter(trash); + times[num++] = t2 - t1; + t1 = t2; + addr += 4096; + } + + printk("Measurements:\n"); + for (x = 0; x < count; x++) { + printk("%d ", times[x]); + if (((x + 1) % 10) == 0) + printk("\n"); + } + printk("\nDone.\n"); + } else +#endif if (dataAddr != 0 && count != 0) { addr = simple_strtoull(dataAddr, NULL, 0); @@ -145,7 +173,7 @@ inline uint32_t cycleCounter(uint32_t dep) return res; } #else -#error Architecture NOT SUPPORTE +#error Architecture NOT SUPPORTED #endif static void __exit devtime_end(void) @@ -162,3 +190,6 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); module_param(dataAddr, charp, 0); module_param(count, int, 0); +#ifdef __alpha__ +module_param(memTest, int, 0); +#endif -- cgit v1.2.3