formatting
--HG-- extra : convert_revision : cbd0c148a50643191372fdba2f771d7e145f1bff
This commit is contained in:
parent
f857bd9dff
commit
ef16b46484
1 changed files with 14 additions and 18 deletions
|
@ -55,7 +55,7 @@ static inline uint32_t cycleCounter(uint32_t dep);
|
||||||
static int __init devtime_start(void)
|
static int __init devtime_start(void)
|
||||||
{
|
{
|
||||||
uint64_t addr;
|
uint64_t addr;
|
||||||
uint32_t t1, t2;
|
uint32_t t1, t2;
|
||||||
uint32_t trash;
|
uint32_t trash;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
@ -64,8 +64,7 @@ static int __init devtime_start(void)
|
||||||
|
|
||||||
printk("Devtime Driver Version %s Loaded...\n", DRIVER_VER);
|
printk("Devtime Driver Version %s Loaded...\n", DRIVER_VER);
|
||||||
|
|
||||||
if ((dataAddr != 0) && (count != 0))
|
if (dataAddr != 0 && count != 0) {
|
||||||
{
|
|
||||||
addr = simple_strtoull(dataAddr, NULL, 0);
|
addr = simple_strtoull(dataAddr, NULL, 0);
|
||||||
|
|
||||||
devSum = 0;
|
devSum = 0;
|
||||||
|
@ -77,13 +76,11 @@ static int __init devtime_start(void)
|
||||||
* linear addressing, so its not a problem. But it can fail in x86
|
* linear addressing, so its not a problem. But it can fail in x86
|
||||||
* if physical memory is mapped to this address.
|
* if physical memory is mapped to this address.
|
||||||
*/
|
*/
|
||||||
if (addr)
|
if (addr) {
|
||||||
{
|
|
||||||
printk("Preparing to read %#llx %d times.\n", addr, count);
|
printk("Preparing to read %#llx %d times.\n", addr, count);
|
||||||
|
|
||||||
t1 = cycleCounter(trash);
|
t1 = cycleCounter(trash);
|
||||||
for (x=0; x < count; x++)
|
for (x = 0; x < count; x++) {
|
||||||
{
|
|
||||||
trash = readl(addr);
|
trash = readl(addr);
|
||||||
t2 = cycleCounter(trash);
|
t2 = cycleCounter(trash);
|
||||||
devSum += t2 - t1;
|
devSum += t2 - t1;
|
||||||
|
@ -95,28 +92,26 @@ static int __init devtime_start(void)
|
||||||
*/
|
*/
|
||||||
iounmap(addr);
|
iounmap(addr);
|
||||||
|
|
||||||
printk("Read Address %#llx %ld times. Average latency %ld.\n", addr, devCnt, devSum/devCnt);
|
printk("Read Address %#llx %ld times. Average latency %ld.\n",
|
||||||
|
addr, devCnt, devSum/devCnt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printk("Unable to remap address. Please try again later.\n");
|
printk("Unable to remap address. Please try again later.\n");
|
||||||
} else {
|
} else {
|
||||||
dev = dev_get_by_name("eth0");
|
dev = dev_get_by_name("eth0");
|
||||||
if (dev)
|
if (dev) {
|
||||||
{
|
printk("Eth0: MemStart: %#lx MemEnd: %#lx I/O Addr: %#lx\n",
|
||||||
printk("Eth0: MemStart: %#lx MemEnd: %#lx I/O Addr: %#lx\n", dev->mem_start,
|
dev->mem_start, dev->mem_end, dev->base_addr);
|
||||||
dev->mem_end, dev->base_addr);
|
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
}
|
}
|
||||||
dev = 0;
|
dev = 0;
|
||||||
dev = dev_get_by_name("eth1");
|
dev = dev_get_by_name("eth1");
|
||||||
if (dev)
|
if (dev) {
|
||||||
{
|
printk("Eth1: MemStart: %#lx MemEnd: %#lx I/O Addr: %#lx\n",
|
||||||
printk("Eth1: MemStart: %#lx MemEnd: %#lx I/O Addr: %#lx\n", dev->mem_start,
|
dev->mem_start, dev->mem_end, dev->base_addr);
|
||||||
dev->mem_end, dev->base_addr);
|
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
printk("Required information not supplied.\n");
|
printk("Required information not supplied.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +141,8 @@ inline uint32_t cycleCounter(uint32_t dep)
|
||||||
#error Architecture NOT SUPPORTE
|
#error Architecture NOT SUPPORTE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void __exit devtime_end(void) {
|
static void __exit devtime_end(void)
|
||||||
|
{
|
||||||
printk("Devtime Driver Version %s Unloaded...\n", DRIVER_VER);
|
printk("Devtime Driver Version %s Unloaded...\n", DRIVER_VER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue