cris: convert old cpumask API into new one
Adapt to the new API. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
8ea9716fd6
commit
8aebe21e0f
|
@ -266,11 +266,11 @@ static int irq_cpu(int irq)
|
||||||
|
|
||||||
|
|
||||||
/* Let the interrupt stay if possible */
|
/* Let the interrupt stay if possible */
|
||||||
if (cpu_isset(cpu, irq_allocations[irq - FIRST_IRQ].mask))
|
if (cpumask_test_cpu(cpu, &irq_allocations[irq - FIRST_IRQ].mask))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* IRQ must be moved to another CPU. */
|
/* IRQ must be moved to another CPU. */
|
||||||
cpu = first_cpu(irq_allocations[irq - FIRST_IRQ].mask);
|
cpu = cpumask_first(&irq_allocations[irq - FIRST_IRQ].mask);
|
||||||
irq_allocations[irq - FIRST_IRQ].cpu = cpu;
|
irq_allocations[irq - FIRST_IRQ].cpu = cpu;
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(&irq_lock, flags);
|
spin_unlock_irqrestore(&irq_lock, flags);
|
||||||
|
|
|
@ -81,7 +81,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
||||||
|
|
||||||
/* Mark all possible CPUs as present */
|
/* Mark all possible CPUs as present */
|
||||||
for (i = 0; i < max_cpus; i++)
|
for (i = 0; i < max_cpus; i++)
|
||||||
cpu_set(i, phys_cpu_present_map);
|
cpumask_set_cpu(i, &phys_cpu_present_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __devinit smp_prepare_boot_cpu(void)
|
void __devinit smp_prepare_boot_cpu(void)
|
||||||
|
@ -98,7 +98,7 @@ void __devinit smp_prepare_boot_cpu(void)
|
||||||
SUPP_REG_WR(RW_MM_TLB_PGD, pgd);
|
SUPP_REG_WR(RW_MM_TLB_PGD, pgd);
|
||||||
|
|
||||||
set_cpu_online(0, true);
|
set_cpu_online(0, true);
|
||||||
cpu_set(0, phys_cpu_present_map);
|
cpumask_set_cpu(0, &phys_cpu_present_map);
|
||||||
set_cpu_possible(0, true);
|
set_cpu_possible(0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +112,9 @@ smp_boot_one_cpu(int cpuid)
|
||||||
{
|
{
|
||||||
unsigned timeout;
|
unsigned timeout;
|
||||||
struct task_struct *idle;
|
struct task_struct *idle;
|
||||||
cpumask_t cpu_mask = CPU_MASK_NONE;
|
cpumask_t cpu_mask;
|
||||||
|
|
||||||
|
cpumask_clear(&cpu_mask);
|
||||||
idle = fork_idle(cpuid);
|
idle = fork_idle(cpuid);
|
||||||
if (IS_ERR(idle))
|
if (IS_ERR(idle))
|
||||||
panic("SMP: fork failed for CPU:%d", cpuid);
|
panic("SMP: fork failed for CPU:%d", cpuid);
|
||||||
|
@ -125,10 +126,10 @@ smp_boot_one_cpu(int cpuid)
|
||||||
cpu_now_booting = cpuid;
|
cpu_now_booting = cpuid;
|
||||||
|
|
||||||
/* Kick it */
|
/* Kick it */
|
||||||
cpu_set(cpuid, cpu_online_map);
|
set_cpu_online(cpuid, true);
|
||||||
cpu_set(cpuid, cpu_mask);
|
cpumask_set_cpu(cpuid, &cpu_mask);
|
||||||
send_ipi(IPI_BOOT, 0, cpu_mask);
|
send_ipi(IPI_BOOT, 0, cpu_mask);
|
||||||
cpu_clear(cpuid, cpu_online_map);
|
set_cpu_online(cpuid, false);
|
||||||
|
|
||||||
/* Wait for CPU to come online */
|
/* Wait for CPU to come online */
|
||||||
for (timeout = 0; timeout < 10000; timeout++) {
|
for (timeout = 0; timeout < 10000; timeout++) {
|
||||||
|
@ -176,7 +177,7 @@ void __init smp_callin(void)
|
||||||
notify_cpu_starting(cpu);
|
notify_cpu_starting(cpu);
|
||||||
local_irq_enable();
|
local_irq_enable();
|
||||||
|
|
||||||
cpu_set(cpu, cpu_online_map);
|
set_cpu_online(cpu, true);
|
||||||
cpu_idle();
|
cpu_idle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,8 +215,9 @@ int __cpuinit __cpu_up(unsigned int cpu)
|
||||||
|
|
||||||
void smp_send_reschedule(int cpu)
|
void smp_send_reschedule(int cpu)
|
||||||
{
|
{
|
||||||
cpumask_t cpu_mask = CPU_MASK_NONE;
|
cpumask_t cpu_mask;
|
||||||
cpu_set(cpu, cpu_mask);
|
cpumask_clear(&cpu_mask);
|
||||||
|
cpumask_set_cpu(cpu, &cpu_mask);
|
||||||
send_ipi(IPI_SCHEDULE, 0, cpu_mask);
|
send_ipi(IPI_SCHEDULE, 0, cpu_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +234,7 @@ void flush_tlb_common(struct mm_struct* mm, struct vm_area_struct* vma, unsigned
|
||||||
|
|
||||||
spin_lock_irqsave(&tlbstate_lock, flags);
|
spin_lock_irqsave(&tlbstate_lock, flags);
|
||||||
cpu_mask = (mm == FLUSH_ALL ? cpu_all_mask : *mm_cpumask(mm));
|
cpu_mask = (mm == FLUSH_ALL ? cpu_all_mask : *mm_cpumask(mm));
|
||||||
cpu_clear(smp_processor_id(), cpu_mask);
|
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
|
||||||
flush_mm = mm;
|
flush_mm = mm;
|
||||||
flush_vma = vma;
|
flush_vma = vma;
|
||||||
flush_addr = addr;
|
flush_addr = addr;
|
||||||
|
@ -277,10 +279,10 @@ int send_ipi(int vector, int wait, cpumask_t cpu_mask)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* Calculate CPUs to send to. */
|
/* Calculate CPUs to send to. */
|
||||||
cpus_and(cpu_mask, cpu_mask, cpu_online_map);
|
cpumask_and(&cpu_mask, &cpu_mask, cpu_online_mask);
|
||||||
|
|
||||||
/* Send the IPI. */
|
/* Send the IPI. */
|
||||||
for_each_cpu_mask(i, cpu_mask)
|
for_each_cpu(i, &cpu_mask)
|
||||||
{
|
{
|
||||||
ipi.vector |= vector;
|
ipi.vector |= vector;
|
||||||
REG_WR(intr_vect, irq_regs[i], rw_ipi, ipi);
|
REG_WR(intr_vect, irq_regs[i], rw_ipi, ipi);
|
||||||
|
@ -288,7 +290,7 @@ int send_ipi(int vector, int wait, cpumask_t cpu_mask)
|
||||||
|
|
||||||
/* Wait for IPI to finish on other CPUS */
|
/* Wait for IPI to finish on other CPUS */
|
||||||
if (wait) {
|
if (wait) {
|
||||||
for_each_cpu_mask(i, cpu_mask) {
|
for_each_cpu(i, &cpu_mask) {
|
||||||
int j;
|
int j;
|
||||||
for (j = 0 ; j < 1000; j++) {
|
for (j = 0 ; j < 1000; j++) {
|
||||||
ipi = REG_RD(intr_vect, irq_regs[i], rw_ipi);
|
ipi = REG_RD(intr_vect, irq_regs[i], rw_ipi);
|
||||||
|
@ -314,11 +316,12 @@ int send_ipi(int vector, int wait, cpumask_t cpu_mask)
|
||||||
*/
|
*/
|
||||||
int smp_call_function(void (*func)(void *info), void *info, int wait)
|
int smp_call_function(void (*func)(void *info), void *info, int wait)
|
||||||
{
|
{
|
||||||
cpumask_t cpu_mask = CPU_MASK_ALL;
|
cpumask_t cpu_mask;
|
||||||
struct call_data_struct data;
|
struct call_data_struct data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cpu_clear(smp_processor_id(), cpu_mask);
|
cpumask_setall(&cpu_mask);
|
||||||
|
cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
|
||||||
|
|
||||||
WARN_ON(irqs_disabled());
|
WARN_ON(irqs_disabled());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue