clean up tsc sched patch

SVN-Revision: 2499
This commit is contained in:
Felix Fietkau 2005-11-15 14:48:10 +00:00
parent b4f12fb36f
commit b5eda794a8
2 changed files with 16 additions and 8 deletions

View File

@ -1,7 +1,7 @@
diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c 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.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 +++ linux.dev/arch/mips/kernel/time.c 2005-11-15 15:21:17.890005500 +0100
@@ -151,6 +151,16 @@ @@ -151,6 +151,20 @@
unsigned int (*mips_hpt_read)(void); unsigned int (*mips_hpt_read)(void);
void (*mips_hpt_init)(unsigned int); void (*mips_hpt_init)(unsigned int);
@ -13,12 +13,16 @@ diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c
+extern __u64 get_tscll(void) +extern __u64 get_tscll(void)
+{ +{
+ __u32 c = read_c0_count(); + __u32 c = read_c0_count();
+ return ((((__u64) timerhi) + (c < timerlo)) << 32) | ((__u64) ((__u32) c)); + __u64 h = (__u64) timerhi;
+ h += (c < timerlo);
+ h <<= 32;
+ h += c;
+ return h;
+} +}
/* /*
* timeofday services, for syscalls. * timeofday services, for syscalls.
@@ -761,3 +771,5 @@ @@ -761,3 +775,5 @@
EXPORT_SYMBOL(to_tm); EXPORT_SYMBOL(to_tm);
EXPORT_SYMBOL(rtc_set_time); EXPORT_SYMBOL(rtc_set_time);
EXPORT_SYMBOL(rtc_get_time); EXPORT_SYMBOL(rtc_get_time);

View File

@ -1,7 +1,7 @@
diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c 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.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 +++ linux.dev/arch/mips/kernel/time.c 2005-11-15 15:21:17.890005500 +0100
@@ -151,6 +151,16 @@ @@ -151,6 +151,20 @@
unsigned int (*mips_hpt_read)(void); unsigned int (*mips_hpt_read)(void);
void (*mips_hpt_init)(unsigned int); void (*mips_hpt_init)(unsigned int);
@ -13,12 +13,16 @@ diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c
+extern __u64 get_tscll(void) +extern __u64 get_tscll(void)
+{ +{
+ __u32 c = read_c0_count(); + __u32 c = read_c0_count();
+ return ((((__u64) timerhi) + (c < timerlo)) << 32) | ((__u64) ((__u32) c)); + __u64 h = (__u64) timerhi;
+ h += (c < timerlo);
+ h <<= 32;
+ h += c;
+ return h;
+} +}
/* /*
* timeofday services, for syscalls. * timeofday services, for syscalls.
@@ -761,3 +771,5 @@ @@ -761,3 +775,5 @@
EXPORT_SYMBOL(to_tm); EXPORT_SYMBOL(to_tm);
EXPORT_SYMBOL(rtc_set_time); EXPORT_SYMBOL(rtc_set_time);
EXPORT_SYMBOL(rtc_get_time); EXPORT_SYMBOL(rtc_get_time);