summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKanoj Sarcar <kanoj@engr.sgi.com>2000-03-27 00:52:39 +0000
committerKanoj Sarcar <kanoj@engr.sgi.com>2000-03-27 00:52:39 +0000
commit59b8fa3c0ef4798eabf4428a5c9071c6dfa81159 (patch)
tree3b23d6b9da16436442cdf34c126b3eafd92f0762 /arch
parent257ebf3ea364760535f26a4f86feef64ccf3e4b4 (diff)
ip27-timer.c: The timer interrupt for SMP machines must do some extra
scheduling related tasks. smp.c: create a stub to flush tlbs on other processors.
Diffstat (limited to 'arch')
-rw-r--r--arch/mips64/kernel/smp.c6
-rw-r--r--arch/mips64/sgi-ip27/ip27-timer.c31
2 files changed, 36 insertions, 1 deletions
diff --git a/arch/mips64/kernel/smp.c b/arch/mips64/kernel/smp.c
index 05931794d..d72e97904 100644
--- a/arch/mips64/kernel/smp.c
+++ b/arch/mips64/kernel/smp.c
@@ -85,3 +85,9 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
/* XXX - kinda important ;-) */
panic("smp_call_function\n");
}
+
+void flush_tlb_others (unsigned long cpumask, struct mm_struct *mm,
+ unsigned long va)
+{
+ panic("flush_tlb_others\n");
+}
diff --git a/arch/mips64/sgi-ip27/ip27-timer.c b/arch/mips64/sgi-ip27/ip27-timer.c
index ff6ea60e7..5b74fffc0 100644
--- a/arch/mips64/sgi-ip27/ip27-timer.c
+++ b/arch/mips64/sgi-ip27/ip27-timer.c
@@ -89,6 +89,8 @@ static int set_rtc_mmss(unsigned long nowtime)
void rt_timer_interrupt(struct pt_regs *regs)
{
+ int cpu = smp_processor_id();
+ int user = user_mode(regs);
int irq = 7; /* XXX Assign number */
write_lock(&xtime_lock);
@@ -101,8 +103,35 @@ again:
if (LOCAL_HUB_L(PI_RT_COUNT) >= ct_cur)
goto again;
- kstat.irqs[0][irq]++;
+ kstat.irqs[cpu][irq]++; /* kstat+do_timer only for bootcpu? */
do_timer(regs);
+
+#ifdef CONFIG_SMP
+ if (current->pid) {
+ unsigned int *inc, *inc2;
+
+ update_one_process(current, 1, user, !user, cpu);
+ if (--current->counter <= 0) {
+ current->counter = 0;
+ current->need_resched = 1;
+ }
+
+ if (user) {
+ if (current->priority < DEF_PRIORITY) {
+ inc = &kstat.cpu_nice;
+ inc2 = &kstat.per_cpu_nice[cpu];
+ } else {
+ inc = &kstat.cpu_user;
+ inc2 = &kstat.per_cpu_user[cpu];
+ }
+ } else {
+ inc = &kstat.cpu_system;
+ inc2 = &kstat.per_cpu_system[cpu];
+ }
+ atomic_inc((atomic_t *)inc);
+ atomic_inc((atomic_t *)inc2);
+ }
+#endif /* CONFIG_SMP */
/*
* If we have an externally synchronized Linux clock, then update