From 59b8fa3c0ef4798eabf4428a5c9071c6dfa81159 Mon Sep 17 00:00:00 2001 From: Kanoj Sarcar Date: Mon, 27 Mar 2000 00:52:39 +0000 Subject: 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. --- arch/mips64/kernel/smp.c | 6 ++++++ arch/mips64/sgi-ip27/ip27-timer.c | 31 ++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3