20 #include <linux/sched.h>
27 #include <asm/cacheflush.h>
28 #include <asm/pgalloc.h>
31 #include <asm/mmu_context.h>
33 #include <asm/tlbflush.h>
43 static volatile unsigned long flushcache_cpumask = 0;
51 static volatile unsigned long flush_va;
53 #define FLUSH_ALL 0xffffffff
68 static void flush_tlb_all_ipi(
void *);
79 static void send_IPI_allbutself(
int,
int);
80 static void send_IPI_mask(
const struct cpumask *,
int,
int);
107 send_IPI_mask(
cpumask_of(cpu_id), RESCHEDULE_IPI, 1);
157 spin_lock(&flushcache_lock);
160 send_IPI_mask(&cpumask, INVALIDATE_CACHE_IPI, 0);
162 while (flushcache_cpumask)
164 spin_unlock(&flushcache_lock);
225 static void flush_tlb_all_ipi(
void *
info)
256 cpumask_copy(&cpu_mask, mm_cpumask(mm));
257 cpumask_clear_cpu(cpu_id, &cpu_mask);
265 cpumask_clear_cpu(cpu_id, mm_cpumask(mm));
268 if (!cpumask_empty(&cpu_mask))
326 cpumask_copy(&cpu_mask, mm_cpumask(mm));
327 cpumask_clear_cpu(cpu_id, &cpu_mask);
341 if (!cpumask_empty(&cpu_mask))
377 if (!(flags & 0x0040))
388 BUG_ON(cpumask_empty(&cpumask));
394 cpumask_and(&cpumask, &cpumask, cpu_online_mask);
395 if (cpumask_empty(&cpumask))
404 spin_lock(&tlbstate_lock);
416 send_IPI_mask(&cpumask, INVALIDATE_TLB_IPI, 0);
418 while (!cpumask_empty((
cpumask_t*)&flush_cpumask)) {
426 spin_unlock(&tlbstate_lock);
458 if (flush_mm ==
current->active_mm)
461 cpumask_clear_cpu(cpu_id, mm_cpumask(flush_mm));
463 unsigned long va = flush_va;
471 cpumask_clear_cpu(cpu_id, (
cpumask_t*)&flush_cpumask);
540 send_IPI_mask(mask, CALL_FUNCTION_IPI, 0);
545 send_IPI_mask(
cpumask_of(cpu), CALL_FUNC_SINGLE_IPI, 0);
568 generic_smp_call_function_interrupt();
575 generic_smp_call_function_single_interrupt();
602 send_IPI_allbutself(LOCAL_TIMER_IPI, 1);
625 old_regs = set_irq_regs(regs);
629 set_irq_regs(old_regs);
669 if (--
per_cpu(prof_counter, cpu_id) <= 0) {
679 =
per_cpu(prof_multiplier, cpu_id);
680 if (
per_cpu(prof_counter, cpu_id)
681 !=
per_cpu(prof_old_multiplier, cpu_id))
683 per_cpu(prof_old_multiplier, cpu_id)
684 =
per_cpu(prof_counter, cpu_id);
714 static void send_IPI_allbutself(
int ipi_num,
int try)
718 cpumask_copy(&cpumask, cpu_online_mask);
721 send_IPI_mask(&cpumask, ipi_num,
try);
744 static void send_IPI_mask(
const struct cpumask *cpumask,
int ipi_num,
int try)
753 cpumask_and(&tmp, cpumask, cpu_online_mask);
754 BUG_ON(!cpumask_equal(cpumask, &tmp));
756 cpumask_clear(&physid_mask);
758 if ((phys_id = cpu_to_physid(cpu_id)) != -1)
759 cpumask_set_cpu(phys_id, &physid_mask);
789 volatile unsigned long *ipicr_addr;
790 unsigned long ipicr_val;
791 unsigned long my_physid_mask;
797 if (ipi_num >= NR_IPIS || ipi_num < 0)
801 ipilock = &ipi_lock[ipi_num];
814 ";; CHECK IPICRi == 0 \n\t"
822 ";; WRITE IPICRi (send IPIi) \n\t"
829 :
"r"(ipicr_addr),
"r"(mask),
"r"(
try),
"r"(my_physid_mask)
832 spin_unlock(ipilock);