X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/8c87fd5df0ea2627fa612fda7cf71f107201ddc4..f15908485431a65bd7d9317272ef28e4b700a19d:/target/linux/linux-2.4/patches/brcm/007-sched_use_tsc.patch diff --git a/target/linux/linux-2.4/patches/brcm/007-sched_use_tsc.patch b/target/linux/linux-2.4/patches/brcm/007-sched_use_tsc.patch index 73d177b10..5b6431073 100644 --- a/target/linux/linux-2.4/patches/brcm/007-sched_use_tsc.patch +++ b/target/linux/linux-2.4/patches/brcm/007-sched_use_tsc.patch @@ -1,7 +1,7 @@ diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c --- linux.old/arch/mips/kernel/time.c 2005-11-14 11:06:38.661262000 +0100 -+++ linux.dev/arch/mips/kernel/time.c 2005-11-14 11:10:42.856523250 +0100 -@@ -151,6 +151,16 @@ ++++ linux.dev/arch/mips/kernel/time.c 2005-11-15 20:02:50.059676750 +0100 +@@ -151,6 +151,27 @@ unsigned int (*mips_hpt_read)(void); void (*mips_hpt_init)(unsigned int); @@ -10,15 +10,26 @@ diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c + return timerhi; +} + ++static __u64 tscll_last = 0; ++ +extern __u64 get_tscll(void) +{ ++ __u64 h = (__u64) timerhi; + __u32 c = read_c0_count(); -+ return ((((__u64) timerhi) + (c < timerlo)) << 32) | ((__u64) ((__u32) c)); ++ ++ h <<= 32; ++ h += c; ++ ++ while (h < tscll_last) ++ h += (((__u64) 1) << 32); ++ ++ tscll_last = h; ++ return h; +} /* * timeofday services, for syscalls. -@@ -761,3 +771,5 @@ +@@ -761,3 +782,5 @@ EXPORT_SYMBOL(to_tm); EXPORT_SYMBOL(rtc_set_time); EXPORT_SYMBOL(rtc_get_time);