2009-05-15 10:36:04 +00:00
|
|
|
--- a/arch/mips/kernel/time.c
|
|
|
|
+++ b/arch/mips/kernel/time.c
|
2008-05-19 13:44:11 +00:00
|
|
|
@@ -151,6 +151,27 @@ void (*mips_timer_ack)(void);
|
2005-11-10 02:19:29 +00:00
|
|
|
unsigned int (*mips_hpt_read)(void);
|
|
|
|
void (*mips_hpt_init)(unsigned int);
|
|
|
|
|
|
|
|
+extern __u32 get_htscl(void)
|
|
|
|
+{
|
|
|
|
+ return timerhi;
|
|
|
|
+}
|
|
|
|
+
|
2005-11-15 19:24:51 +00:00
|
|
|
+static __u64 tscll_last = 0;
|
|
|
|
+
|
2005-11-10 02:19:29 +00:00
|
|
|
+extern __u64 get_tscll(void)
|
|
|
|
+{
|
2005-11-15 14:48:10 +00:00
|
|
|
+ __u64 h = (__u64) timerhi;
|
2005-11-15 19:24:51 +00:00
|
|
|
+ __u32 c = read_c0_count();
|
|
|
|
+
|
2005-11-15 14:48:10 +00:00
|
|
|
+ h <<= 32;
|
|
|
|
+ h += c;
|
2005-11-15 19:24:51 +00:00
|
|
|
+
|
|
|
|
+ while (h < tscll_last)
|
|
|
|
+ h += (((__u64) 1) << 32);
|
|
|
|
+
|
|
|
|
+ tscll_last = h;
|
2005-11-15 14:48:10 +00:00
|
|
|
+ return h;
|
2005-11-10 02:19:29 +00:00
|
|
|
+}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* timeofday services, for syscalls.
|
2008-05-19 13:44:11 +00:00
|
|
|
@@ -761,3 +782,5 @@ EXPORT_SYMBOL(rtc_lock);
|
2005-11-10 02:19:29 +00:00
|
|
|
EXPORT_SYMBOL(to_tm);
|
|
|
|
EXPORT_SYMBOL(rtc_set_time);
|
|
|
|
EXPORT_SYMBOL(rtc_get_time);
|
|
|
|
+EXPORT_SYMBOL(get_htscl);
|
|
|
|
+EXPORT_SYMBOL(get_tscll);
|
2009-05-15 10:36:04 +00:00
|
|
|
--- a/include/asm-mips/timex.h
|
|
|
|
+++ b/include/asm-mips/timex.h
|
2008-05-19 13:44:11 +00:00
|
|
|
@@ -31,6 +31,19 @@ static inline cycles_t get_cycles (void)
|
2005-11-10 02:19:29 +00:00
|
|
|
return read_c0_count();
|
|
|
|
}
|
|
|
|
|
|
|
|
+extern __u32 get_htscl(void);
|
|
|
|
+extern __u64 get_tscll(void);
|
|
|
|
+
|
|
|
|
+#define rdtsc(low, high) \
|
|
|
|
+ high = get_htscl(); \
|
|
|
|
+ low = read_c0_count();
|
|
|
|
+
|
|
|
|
+#define rdtscl(low) \
|
|
|
|
+ low = read_c0_count();
|
|
|
|
+
|
|
|
|
+#define rdtscll(val) \
|
|
|
|
+ val = get_tscll();
|
|
|
|
+
|
|
|
|
#define vxtime_lock() do {} while (0)
|
|
|
|
#define vxtime_unlock() do {} while (0)
|
|
|
|
|
2009-05-15 10:36:04 +00:00
|
|
|
--- a/include/net/pkt_sched.h
|
|
|
|
+++ b/include/net/pkt_sched.h
|
2005-11-10 02:19:29 +00:00
|
|
|
@@ -5,7 +5,11 @@
|
|
|
|
#define PSCHED_JIFFIES 2
|
|
|
|
#define PSCHED_CPU 3
|
|
|
|
|
|
|
|
+#ifdef __mips__
|
|
|
|
+#define PSCHED_CLOCK_SOURCE PSCHED_CPU
|
|
|
|
+#else
|
|
|
|
#define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#include <linux/config.h>
|
|
|
|
#include <linux/types.h>
|
2008-05-19 13:44:11 +00:00
|
|
|
@@ -261,7 +265,7 @@ extern int psched_clock_scale;
|
2005-11-10 02:19:29 +00:00
|
|
|
#define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
|
|
|
|
#define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
|
|
|
|
|
|
|
|
-#ifdef CONFIG_X86_TSC
|
|
|
|
+#if defined(CONFIG_X86_TSC) || defined(__mips__)
|
|
|
|
|
|
|
|
#define PSCHED_GET_TIME(stamp) \
|
|
|
|
({ u64 __cur; \
|