Deleted Added
sdiff udiff text old ( 1053:2c6d9e60541b ) new ( 1068:6330fe678283 )
full compact
1/*
2 * Copyright (c) 2004 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 34 unchanged lines hidden (view full) ---

43#endif
44
45#define DRIVER_AUTHOR "Ali Saidi"
46#define DRIVER_DESC "Interface to time uncacachable read and writes to device registers"
47#define DRIVER_VER "0.1"
48
49static char *dataAddr = NULL;
50static int count = 0;
51
52static inline uint32_t cycleCounter(uint32_t dep);
53
54static int __init devtime_start(void)
55{
56 uint64_t addr;
57 uint32_t t1, t2;
58 uint32_t trash;
59 int x;
60 uint32_t *times;
61 uint32_t num = 0;
62 struct net_device *dev;
63
64 printk("Devtime Driver Version %s Loaded...\n", DRIVER_VER);
65
66 if (dataAddr != 0 && count != 0) {
67 addr = simple_strtoull(dataAddr, NULL, 0);
68
69 addr = ioremap(addr, PAGE_SIZE);
70 /**
71 * Make sure that the remapping actually worked. On alpha we have
72 * linear addressing, so its not a problem. But it can fail in x86
73 * if physical memory is mapped to this address.

--- 66 unchanged lines hidden (view full) ---

140
141inline uint32_t cycleCounter(uint32_t dep)
142{
143 uint32_t res;
144 asm volatile ("rpcc %0, %1" : "=r"(res) : "r" (dep) : "memory");
145 return res;
146}
147#else
148#error Architecture NOT SUPPORTE
149#endif
150
151static void __exit devtime_end(void)
152{
153 printk("Devtime Driver Version %s Unloaded...\n", DRIVER_VER);
154}
155
156
157module_init(devtime_start);
158module_exit(devtime_end);
159
160MODULE_LICENSE("Dual BSD/GPL");
161MODULE_AUTHOR(DRIVER_AUTHOR);
162MODULE_DESCRIPTION(DRIVER_DESC);
163module_param(dataAddr, charp, 0);
164module_param(count, int, 0);