1 --- a/arch/mips/kernel/time.c
2 +++ b/arch/mips/kernel/time.c
3 @@ -151,6 +151,27 @@ void (*mips_timer_ack)(void);
4 unsigned int (*mips_hpt_read)(void);
5 void (*mips_hpt_init)(unsigned int);
7 +extern __u32 get_htscl(void)
12 +static __u64 tscll_last = 0;
14 +extern __u64 get_tscll(void)
16 + __u64 h = (__u64) timerhi;
17 + __u32 c = read_c0_count();
22 + while (h < tscll_last)
23 + h += (((__u64) 1) << 32);
30 * timeofday services, for syscalls.
31 @@ -761,3 +782,5 @@ EXPORT_SYMBOL(rtc_lock);
33 EXPORT_SYMBOL(rtc_set_time);
34 EXPORT_SYMBOL(rtc_get_time);
35 +EXPORT_SYMBOL(get_htscl);
36 +EXPORT_SYMBOL(get_tscll);
37 --- a/include/asm-mips/timex.h
38 +++ b/include/asm-mips/timex.h
39 @@ -31,6 +31,19 @@ static inline cycles_t get_cycles (void)
40 return read_c0_count();
43 +extern __u32 get_htscl(void);
44 +extern __u64 get_tscll(void);
46 +#define rdtsc(low, high) \
47 + high = get_htscl(); \
48 + low = read_c0_count();
50 +#define rdtscl(low) \
51 + low = read_c0_count();
53 +#define rdtscll(val) \
56 #define vxtime_lock() do {} while (0)
57 #define vxtime_unlock() do {} while (0)
59 --- a/include/net/pkt_sched.h
60 +++ b/include/net/pkt_sched.h
62 #define PSCHED_JIFFIES 2
66 +#define PSCHED_CLOCK_SOURCE PSCHED_CPU
68 #define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES
71 #include <linux/config.h>
72 #include <linux/types.h>
73 @@ -261,7 +265,7 @@ extern int psched_clock_scale;
74 #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
75 #define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
77 -#ifdef CONFIG_X86_TSC
78 +#if defined(CONFIG_X86_TSC) || defined(__mips__)
80 #define PSCHED_GET_TIME(stamp) \