cleanups
[ust.git] / share / kernelcompat.h
index 63964888e6de5f93850e230ea899d047d0c75d6b..2a8e0f253d1158e637d53f130eea3ca49de8b241 100644 (file)
@@ -1,10 +1,9 @@
 #ifndef KERNELCOMPAT_H
 #define KERNELCOMPAT_H
 
+#include <compiler.h>
 #include <kcompat.h>
 
-#include "compiler.h"
-
 #include <string.h>
 #include <sys/time.h>
 
@@ -93,8 +92,6 @@ static inline long IS_ERR(const void *ptr)
 /* ATTRIBUTES */
 
 #define ____cacheline_aligned
-#define __init
-#define __exit
 
 /* MATH */
 
@@ -142,7 +139,7 @@ static __inline__ int get_count_order(unsigned int count)
 #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))
 
 
 
@@ -153,18 +150,19 @@ static __inline__ int get_count_order(unsigned int count)
 
 /* 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)
+{
+       uint32_t low;
+       uint32_t high;
+       uint64_t retval;
+       __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high));
+
+       retval = high;
+       retval <<= 32;
+       return retval | low;
+}
 
+#if 0
 static inline u64 trace_clock_read64(void)
 {
        struct timeval tv;
@@ -177,6 +175,7 @@ static inline u64 trace_clock_read64(void)
 
        return retval;
 }
+#endif
 
 static inline u64 trace_clock_frequency(void)
 {
@@ -189,14 +188,4 @@ static inline u32 trace_clock_freq_scale(void)
 }
 
 
-/* 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 */
This page took 0.02381 seconds and 4 git commands to generate.