/* ATTRIBUTES */
#define ____cacheline_aligned
-#define __init
-#define __exit
/* MATH */
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#define PAGE_MASK (PAGE_SIZE-1)
+#define PAGE_MASK (~(PAGE_SIZE-1))
/* TRACE CLOCK */
-//ust// static inline u64 trace_clock_read64(void)
-//ust// {
-//ust// uint32_t low;
-//ust// uint32_t high;
-//ust// uint64_t retval;
-//ust// __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high));
-//ust//
-//ust// retval = high;
-//ust// retval <<= 32;
-//ust// return retval | low;
-//ust// }
-
static inline u64 trace_clock_read64(void)
{
- struct timeval tv;
- u64 retval;
-
- gettimeofday(&tv, NULL);
- retval = tv.tv_sec;
- retval *= 1000000;
- retval += tv.tv_usec;
-
- return retval;
+ uint32_t low;
+ uint32_t high;
+ uint64_t retval;
+ __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high));
+
+ retval = high;
+ retval <<= 32;
+ return retval | low;
}
+//static inline u64 trace_clock_read64(void)
+//{
+// struct timeval tv;
+// u64 retval;
+//
+// gettimeofday(&tv, NULL);
+// retval = tv.tv_sec;
+// retval *= 1000000;
+// retval += tv.tv_usec;
+//
+// return retval;
+//}
+
static inline u64 trace_clock_frequency(void)
{
return 1000000LL;
}
-/* LISTS */
-
-#define list_add_rcu list_add
-#define list_for_each_entry_rcu list_for_each_entry
-
-
-#define EXPORT_SYMBOL_GPL(a) /*nothing*/
-
-#define smp_processor_id() (-1)
-
#endif /* KERNELCOMPAT_H */