1 Index: linux-2.4.35.4/arch/mips/kernel/time.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/arch/mips/kernel/time.c
4 +++ linux-2.4.35.4/arch/mips/kernel/time.c
5 @@ -151,6 +151,27 @@ void (*mips_timer_ack)(void);
6 unsigned int (*mips_hpt_read)(void);
7 void (*mips_hpt_init)(unsigned int);
9 +extern __u32 get_htscl(void)
14 +static __u64 tscll_last = 0;
16 +extern __u64 get_tscll(void)
18 + __u64 h = (__u64) timerhi;
19 + __u32 c = read_c0_count();
24 + while (h < tscll_last)
25 + h += (((__u64) 1) << 32);
32 * timeofday services, for syscalls.
33 @@ -761,3 +782,5 @@ EXPORT_SYMBOL(rtc_lock);
35 EXPORT_SYMBOL(rtc_set_time);
36 EXPORT_SYMBOL(rtc_get_time);
37 +EXPORT_SYMBOL(get_htscl);
38 +EXPORT_SYMBOL(get_tscll);
39 Index: linux-2.4.35.4/include/asm-mips/timex.h
40 ===================================================================
41 --- linux-2.4.35.4.orig/include/asm-mips/timex.h
42 +++ linux-2.4.35.4/include/asm-mips/timex.h
43 @@ -31,6 +31,19 @@ static inline cycles_t get_cycles (void)
44 return read_c0_count();
47 +extern __u32 get_htscl(void);
48 +extern __u64 get_tscll(void);
50 +#define rdtsc(low, high) \
51 + high = get_htscl(); \
52 + low = read_c0_count();
54 +#define rdtscl(low) \
55 + low = read_c0_count();
57 +#define rdtscll(val) \
60 #define vxtime_lock() do {} while (0)
61 #define vxtime_unlock() do {} while (0)
63 Index: linux-2.4.35.4/include/net/pkt_sched.h
64 ===================================================================
65 --- linux-2.4.35.4.orig/include/net/pkt_sched.h
66 +++ linux-2.4.35.4/include/net/pkt_sched.h
68 #define PSCHED_JIFFIES 2
72 +#define PSCHED_CLOCK_SOURCE PSCHED_CPU
74 #define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES
77 #include <linux/config.h>
78 #include <linux/types.h>
79 @@ -261,7 +265,7 @@ extern int psched_clock_scale;
80 #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
81 #define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
83 -#ifdef CONFIG_X86_TSC
84 +#if defined(CONFIG_X86_TSC) || defined(__mips__)
86 #define PSCHED_GET_TIME(stamp) \