git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull sony into release branch
[pandora-kernel.git]
/
arch
/
um
/
kernel
/
time.c
diff --git
a/arch/um/kernel/time.c
b/arch/um/kernel/time.c
index
a92965f
..
b1f8b07
100644
(file)
--- a/
arch/um/kernel/time.c
+++ b/
arch/um/kernel/time.c
@@
-35,31
+35,31
@@
unsigned long long sched_clock(void)
return (unsigned long long)jiffies_64 * (1000000000 / HZ);
}
return (unsigned long long)jiffies_64 * (1000000000 / HZ);
}
-static unsigned long long prev_nsecs;
+static unsigned long long prev_nsecs
[NR_CPUS]
;
#ifdef CONFIG_UML_REAL_TIME_CLOCK
#ifdef CONFIG_UML_REAL_TIME_CLOCK
-static long long delta
;
/* Deviation per interval */
+static long long delta
[NR_CPUS];
/* Deviation per interval */
#endif
void timer_irq(union uml_pt_regs *regs)
{
unsigned long long ticks = 0;
#endif
void timer_irq(union uml_pt_regs *regs)
{
unsigned long long ticks = 0;
-
#ifdef CONFIG_UML_REAL_TIME_CLOCK
#ifdef CONFIG_UML_REAL_TIME_CLOCK
- if(prev_nsecs){
+ int c = cpu();
+ if(prev_nsecs[c]){
/* We've had 1 tick */
unsigned long long nsecs = os_nsecs();
/* We've had 1 tick */
unsigned long long nsecs = os_nsecs();
- delta
+= nsecs - prev_nsecs
;
- prev_nsecs = nsecs;
+ delta
[c] += nsecs - prev_nsecs[c]
;
+ prev_nsecs
[c]
= nsecs;
/* Protect against the host clock being set backwards */
/* Protect against the host clock being set backwards */
- if(delta < 0)
- delta = 0;
+ if(delta
[c]
< 0)
+ delta
[c]
= 0;
- ticks += (delta * HZ) / BILLION;
- delta -= (ticks * BILLION) / HZ;
+ ticks += (delta
[c]
* HZ) / BILLION;
+ delta
[c]
-= (ticks * BILLION) / HZ;
}
}
- else prev_nsecs = os_nsecs();
+ else prev_nsecs
[c]
= os_nsecs();
#else
ticks = 1;
#endif
#else
ticks = 1;
#endif
@@
-69,8
+69,8
@@
void timer_irq(union uml_pt_regs *regs)
}
}
}
}
+/* Protects local_offset */
static DEFINE_SPINLOCK(timer_spinlock);
static DEFINE_SPINLOCK(timer_spinlock);
-
static unsigned long long local_offset = 0;
static inline unsigned long long get_time(void)
static unsigned long long local_offset = 0;
static inline unsigned long long get_time(void)
@@
-86,7
+86,7
@@
static inline unsigned long long get_time(void)
return nsecs;
}
return nsecs;
}
-irqreturn_t um_timer(int irq, void *dev
, struct pt_regs *regs
)
+irqreturn_t um_timer(int irq, void *dev)
{
unsigned long long nsecs;
unsigned long flags;
{
unsigned long long nsecs;
unsigned long flags;