mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
cpumask: convert struct clock_event_device to cpumask pointers.
Impact: change calling convention of existing clock_event APIs struct clock_event_timer's cpumask field gets changed to take pointer, as does the ->broadcast function. Another single-patch change. For safety, we BUG_ON() in clockevents_register_device() if it's not set. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
0de26520c7
commit
320ab2b0b1
@ -169,7 +169,6 @@ static struct clock_event_device clkevt = {
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
|
||||
.shift = 32,
|
||||
.rating = 150,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = clkevt32k_next_event,
|
||||
.set_mode = clkevt32k_mode,
|
||||
};
|
||||
@ -197,7 +196,7 @@ void __init at91rm9200_timer_init(void)
|
||||
clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
|
||||
clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
|
||||
clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
|
||||
clkevt.cpumask = cpumask_of_cpu(0);
|
||||
clkevt.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clkevt);
|
||||
|
||||
/* register clocksource */
|
||||
|
@ -91,7 +91,6 @@ static struct clock_event_device pit_clkevt = {
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC,
|
||||
.shift = 32,
|
||||
.rating = 100,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_mode = pit_clkevt_mode,
|
||||
};
|
||||
|
||||
@ -173,6 +172,7 @@ static void __init at91sam926x_pit_init(void)
|
||||
|
||||
/* Set up and register clockevents */
|
||||
pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift);
|
||||
pit_clkevt.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&pit_clkevt);
|
||||
}
|
||||
|
||||
|
@ -322,7 +322,7 @@ static void __init davinci_timer_init(void)
|
||||
clockevent_davinci.min_delta_ns =
|
||||
clockevent_delta2ns(1, &clockevent_davinci);
|
||||
|
||||
clockevent_davinci.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_davinci.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_davinci);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ static int __init imx_clockevent_init(unsigned long rate)
|
||||
clockevent_imx.min_delta_ns =
|
||||
clockevent_delta2ns(0xf, &clockevent_imx);
|
||||
|
||||
clockevent_imx.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_imx.cpumask = cpumask_of(0);
|
||||
|
||||
clockevents_register_device(&clockevent_imx);
|
||||
|
||||
|
@ -487,7 +487,7 @@ static int __init ixp4xx_clockevent_init(void)
|
||||
clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx);
|
||||
clockevent_ixp4xx.min_delta_ns =
|
||||
clockevent_delta2ns(0xf, &clockevent_ixp4xx);
|
||||
clockevent_ixp4xx.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_ixp4xx.cpumask = cpumask_of(0);
|
||||
|
||||
clockevents_register_device(&clockevent_ixp4xx);
|
||||
return 0;
|
||||
|
@ -182,7 +182,7 @@ static void __init msm_timer_init(void)
|
||||
clockevent_delta2ns(0xf0000000 >> clock->shift, ce);
|
||||
/* 4 gets rounded down to 3 */
|
||||
ce->min_delta_ns = clockevent_delta2ns(4, ce);
|
||||
ce->cpumask = cpumask_of_cpu(0);
|
||||
ce->cpumask = cpumask_of(0);
|
||||
|
||||
cs->mult = clocksource_hz2mult(clock->freq, cs->shift);
|
||||
res = clocksource_register(cs);
|
||||
|
@ -173,7 +173,7 @@ static void __init ns9360_timer_init(void)
|
||||
ns9360_clockevent_device.min_delta_ns =
|
||||
clockevent_delta2ns(1, &ns9360_clockevent_device);
|
||||
|
||||
ns9360_clockevent_device.cpumask = cpumask_of_cpu(0);
|
||||
ns9360_clockevent_device.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&ns9360_clockevent_device);
|
||||
|
||||
setup_irq(IRQ_NS9360_TIMER0 + TIMER_CLOCKEVENT,
|
||||
|
@ -173,7 +173,7 @@ static __init void omap_init_mpu_timer(unsigned long rate)
|
||||
clockevent_mpu_timer1.min_delta_ns =
|
||||
clockevent_delta2ns(1, &clockevent_mpu_timer1);
|
||||
|
||||
clockevent_mpu_timer1.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_mpu_timer1.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_mpu_timer1);
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ static __init void omap_init_32k_timer(void)
|
||||
clockevent_32k_timer.min_delta_ns =
|
||||
clockevent_delta2ns(1, &clockevent_32k_timer);
|
||||
|
||||
clockevent_32k_timer.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_32k_timer.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_32k_timer);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ static void __init omap2_gp_clockevent_init(void)
|
||||
clockevent_gpt.min_delta_ns =
|
||||
clockevent_delta2ns(1, &clockevent_gpt);
|
||||
|
||||
clockevent_gpt.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_gpt.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_gpt);
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,6 @@ static struct clock_event_device ckevt_pxa_osmr0 = {
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT,
|
||||
.shift = 32,
|
||||
.rating = 200,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = pxa_osmr0_set_next_event,
|
||||
.set_mode = pxa_osmr0_set_mode,
|
||||
};
|
||||
@ -170,6 +169,7 @@ static void __init pxa_timer_init(void)
|
||||
clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
|
||||
ckevt_pxa_osmr0.min_delta_ns =
|
||||
clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;
|
||||
ckevt_pxa_osmr0.cpumask = cpumask_of(0);
|
||||
|
||||
cksrc_pxa_oscr0.mult =
|
||||
clocksource_hz2mult(clock_tick_rate, cksrc_pxa_oscr0.shift);
|
||||
|
@ -511,7 +511,7 @@ static struct clock_event_device timer0_clockevent = {
|
||||
.set_mode = timer_set_mode,
|
||||
.set_next_event = timer_set_next_event,
|
||||
.rating = 300,
|
||||
.cpumask = CPU_MASK_ALL,
|
||||
.cpumask = cpu_all_mask,
|
||||
};
|
||||
|
||||
static void __init realview_clockevents_init(unsigned int timer_irq)
|
||||
|
@ -161,7 +161,7 @@ void __cpuinit local_timer_setup(unsigned int cpu)
|
||||
clk->set_mode = local_timer_set_mode;
|
||||
clk->set_next_event = local_timer_set_next_event;
|
||||
clk->irq = IRQ_LOCALTIMER;
|
||||
clk->cpumask = cpumask_of_cpu(cpu);
|
||||
clk->cpumask = cpumask_of(cpu);
|
||||
clk->shift = 20;
|
||||
clk->mult = div_sc(mpcore_timer_rate, NSEC_PER_SEC, clk->shift);
|
||||
clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
|
||||
@ -199,7 +199,7 @@ void __cpuinit local_timer_setup(unsigned int cpu)
|
||||
clk->rating = 200;
|
||||
clk->set_mode = dummy_timer_set_mode;
|
||||
clk->broadcast = smp_timer_broadcast;
|
||||
clk->cpumask = cpumask_of_cpu(cpu);
|
||||
clk->cpumask = cpumask_of(cpu);
|
||||
|
||||
clockevents_register_device(clk);
|
||||
}
|
||||
|
@ -73,7 +73,6 @@ static struct clock_event_device ckevt_sa1100_osmr0 = {
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT,
|
||||
.shift = 32,
|
||||
.rating = 200,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = sa1100_osmr0_set_next_event,
|
||||
.set_mode = sa1100_osmr0_set_mode,
|
||||
};
|
||||
@ -110,6 +109,7 @@ static void __init sa1100_timer_init(void)
|
||||
clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
|
||||
ckevt_sa1100_osmr0.min_delta_ns =
|
||||
clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
|
||||
ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
|
||||
|
||||
cksrc_sa1100_oscr.mult =
|
||||
clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift);
|
||||
|
@ -965,7 +965,7 @@ static void __init versatile_timer_init(void)
|
||||
timer0_clockevent.min_delta_ns =
|
||||
clockevent_delta2ns(0xf, &timer0_clockevent);
|
||||
|
||||
timer0_clockevent.cpumask = cpumask_of_cpu(0);
|
||||
timer0_clockevent.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&timer0_clockevent);
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ static int __init mxc_clockevent_init(void)
|
||||
clockevent_mxc.min_delta_ns =
|
||||
clockevent_delta2ns(0xff, &clockevent_mxc);
|
||||
|
||||
clockevent_mxc.cpumask = cpumask_of_cpu(0);
|
||||
clockevent_mxc.cpumask = cpumask_of(0);
|
||||
|
||||
clockevents_register_device(&clockevent_mxc);
|
||||
|
||||
|
@ -149,7 +149,6 @@ static struct clock_event_device orion_clkevt = {
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
|
||||
.shift = 32,
|
||||
.rating = 300,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = orion_clkevt_next_event,
|
||||
.set_mode = orion_clkevt_mode,
|
||||
};
|
||||
@ -199,5 +198,6 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
|
||||
orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
|
||||
orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt);
|
||||
orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
|
||||
orion_clkevt.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&orion_clkevt);
|
||||
}
|
||||
|
@ -106,7 +106,6 @@ static struct clock_event_device comparator = {
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT,
|
||||
.shift = 16,
|
||||
.rating = 50,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = comparator_next_event,
|
||||
.set_mode = comparator_mode,
|
||||
};
|
||||
@ -134,6 +133,7 @@ void __init time_init(void)
|
||||
comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
|
||||
comparator.max_delta_ns = clockevent_delta2ns((u32)~0, &comparator);
|
||||
comparator.min_delta_ns = clockevent_delta2ns(50, &comparator) + 1;
|
||||
comparator.cpumask = cpumask_of(0);
|
||||
|
||||
sysreg_write(COMPARE, 0);
|
||||
timer_irqaction.dev_id = &comparator;
|
||||
|
@ -162,7 +162,6 @@ static struct clock_event_device clockevent_bfin = {
|
||||
.name = "bfin_core_timer",
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
|
||||
.shift = 32,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = bfin_timer_set_next_event,
|
||||
.set_mode = bfin_timer_set_mode,
|
||||
};
|
||||
@ -193,6 +192,7 @@ static int __init bfin_clockevent_init(void)
|
||||
clockevent_bfin.mult = div_sc(timer_clk, NSEC_PER_SEC, clockevent_bfin.shift);
|
||||
clockevent_bfin.max_delta_ns = clockevent_delta2ns(-1, &clockevent_bfin);
|
||||
clockevent_bfin.min_delta_ns = clockevent_delta2ns(100, &clockevent_bfin);
|
||||
clockevent_bfin.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_bfin);
|
||||
|
||||
return 0;
|
||||
|
@ -156,7 +156,7 @@ void hw_timer_init(void)
|
||||
{
|
||||
u32 imr;
|
||||
|
||||
cf_pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
|
||||
cf_pit_clockevent.cpumask = cpumask_of(smp_processor_id());
|
||||
cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32);
|
||||
cf_pit_clockevent.max_delta_ns =
|
||||
clockevent_delta2ns(0xFFFF, &cf_pit_clockevent);
|
||||
|
@ -146,7 +146,7 @@ void __init plat_time_init(void)
|
||||
|
||||
BUG_ON(HZ != 100);
|
||||
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
clockevents_register_device(cd);
|
||||
action->dev_id = cd;
|
||||
setup_irq(JAZZ_TIMER_IRQ, action);
|
||||
|
@ -126,7 +126,7 @@ void __cpuinit sb1480_clockevent_init(void)
|
||||
cd->min_delta_ns = clockevent_delta2ns(2, cd);
|
||||
cd->rating = 200;
|
||||
cd->irq = irq;
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
cd->set_next_event = sibyte_next_event;
|
||||
cd->set_mode = sibyte_set_mode;
|
||||
clockevents_register_device(cd);
|
||||
|
@ -88,7 +88,6 @@ static void ds1287_event_handler(struct clock_event_device *dev)
|
||||
static struct clock_event_device ds1287_clockevent = {
|
||||
.name = "ds1287",
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = ds1287_set_next_event,
|
||||
.set_mode = ds1287_set_mode,
|
||||
.event_handler = ds1287_event_handler,
|
||||
@ -122,6 +121,7 @@ int __init ds1287_clockevent_init(int irq)
|
||||
clockevent_set_clock(cd, 32768);
|
||||
cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
|
||||
cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
|
||||
cd->cpumask = cpumask_of(0);
|
||||
|
||||
clockevents_register_device(&ds1287_clockevent);
|
||||
|
||||
|
@ -96,7 +96,6 @@ static void gt641xx_timer0_event_handler(struct clock_event_device *dev)
|
||||
static struct clock_event_device gt641xx_timer0_clockevent = {
|
||||
.name = "gt641xx-timer0",
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.irq = GT641XX_TIMER0_IRQ,
|
||||
.set_next_event = gt641xx_timer0_set_next_event,
|
||||
.set_mode = gt641xx_timer0_set_mode,
|
||||
@ -132,6 +131,7 @@ static int __init gt641xx_timer0_clockevent_init(void)
|
||||
clockevent_set_clock(cd, gt641xx_base_clock);
|
||||
cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
|
||||
cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
|
||||
cd->cpumask = cpumask_of(0);
|
||||
|
||||
clockevents_register_device(>641xx_timer0_clockevent);
|
||||
|
||||
|
@ -195,7 +195,7 @@ int __cpuinit mips_clockevent_init(void)
|
||||
|
||||
cd->rating = 300;
|
||||
cd->irq = irq;
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
cd->set_next_event = mips_next_event;
|
||||
cd->set_mode = mips_set_clock_mode;
|
||||
cd->event_handler = mips_event_handler;
|
||||
|
@ -125,7 +125,7 @@ void __cpuinit sb1250_clockevent_init(void)
|
||||
cd->min_delta_ns = clockevent_delta2ns(2, cd);
|
||||
cd->rating = 200;
|
||||
cd->irq = irq;
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
cd->set_next_event = sibyte_next_event;
|
||||
cd->set_mode = sibyte_set_mode;
|
||||
clockevents_register_device(cd);
|
||||
|
@ -292,7 +292,7 @@ int __cpuinit mips_clockevent_init(void)
|
||||
|
||||
cd->rating = 300;
|
||||
cd->irq = irq;
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
cd->set_next_event = mips_next_event;
|
||||
cd->set_mode = mips_set_clock_mode;
|
||||
cd->event_handler = mips_event_handler;
|
||||
|
@ -112,7 +112,6 @@ static struct clock_event_device txx9tmr_clock_event_device = {
|
||||
.name = "TXx9",
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
|
||||
.rating = 200,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_mode = txx9tmr_set_mode,
|
||||
.set_next_event = txx9tmr_set_next_event,
|
||||
};
|
||||
@ -150,6 +149,7 @@ void __init txx9_clockevent_init(unsigned long baseaddr, int irq,
|
||||
clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd);
|
||||
cd->min_delta_ns = clockevent_delta2ns(0xf, cd);
|
||||
cd->irq = irq;
|
||||
cd->cpumask = cpumask_of(0),
|
||||
clockevents_register_device(cd);
|
||||
setup_irq(irq, &txx9tmr_irq);
|
||||
printk(KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n",
|
||||
|
@ -115,7 +115,7 @@ void __init setup_pit_timer(void)
|
||||
* Start pit with the boot cpu mask and make it global after the
|
||||
* IO_APIC has been initialized.
|
||||
*/
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
clockevent_set_clock(cd, CLOCK_TICK_RATE);
|
||||
cd->max_delta_ns = clockevent_delta2ns(0x7FFF, cd);
|
||||
cd->min_delta_ns = clockevent_delta2ns(0xF, cd);
|
||||
|
@ -102,6 +102,7 @@ __init void plat_time_init(void)
|
||||
unsigned int p;
|
||||
unsigned int pow2p;
|
||||
|
||||
pnx8xxx_clockevent.cpumask = cpu_none_mask;
|
||||
clockevents_register_device(&pnx8xxx_clockevent);
|
||||
clocksource_register(&pnx_clocksource);
|
||||
|
||||
|
@ -134,7 +134,7 @@ void __cpuinit hub_rt_clock_event_init(void)
|
||||
cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
|
||||
cd->rating = 200;
|
||||
cd->irq = irq;
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
cd->set_next_event = rt_next_event;
|
||||
cd->set_mode = rt_set_mode;
|
||||
clockevents_register_device(cd);
|
||||
|
@ -80,7 +80,7 @@ static void __init sni_a20r_timer_setup(void)
|
||||
struct irqaction *action = &a20r_irqaction;
|
||||
unsigned int cpu = smp_processor_id();
|
||||
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
clockevents_register_device(cd);
|
||||
action->dev_id = cd;
|
||||
setup_irq(SNI_A20R_IRQ_TIMER, &a20r_irqaction);
|
||||
|
@ -869,7 +869,7 @@ static void register_decrementer_clockevent(int cpu)
|
||||
struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
|
||||
|
||||
*dec = decrementer_clockevent;
|
||||
dec->cpumask = cpumask_of_cpu(cpu);
|
||||
dec->cpumask = cpumask_of(cpu);
|
||||
|
||||
printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
|
||||
dec->name, dec->mult, dec->shift, cpu);
|
||||
|
@ -154,7 +154,7 @@ void init_cpu_timer(void)
|
||||
cd->min_delta_ns = 1;
|
||||
cd->max_delta_ns = LONG_MAX;
|
||||
cd->rating = 400;
|
||||
cd->cpumask = cpumask_of_cpu(cpu);
|
||||
cd->cpumask = cpumask_of(cpu);
|
||||
cd->set_next_event = s390_next_event;
|
||||
cd->set_mode = s390_set_mode;
|
||||
|
||||
|
@ -31,7 +31,7 @@ enum {
|
||||
};
|
||||
|
||||
void smp_message_recv(unsigned int msg);
|
||||
void smp_timer_broadcast(cpumask_t mask);
|
||||
void smp_timer_broadcast(const struct cpumask *mask);
|
||||
|
||||
void local_timer_interrupt(void);
|
||||
void local_timer_setup(unsigned int cpu);
|
||||
|
@ -184,11 +184,11 @@ void arch_send_call_function_single_ipi(int cpu)
|
||||
plat_send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE);
|
||||
}
|
||||
|
||||
void smp_timer_broadcast(cpumask_t mask)
|
||||
void smp_timer_broadcast(const struct cpumask *mask)
|
||||
{
|
||||
int cpu;
|
||||
|
||||
for_each_cpu_mask(cpu, mask)
|
||||
for_each_cpu(cpu, mask)
|
||||
plat_send_ipi(cpu, SMP_MSG_TIMER);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ void __cpuinit local_timer_setup(unsigned int cpu)
|
||||
clk->mult = 1;
|
||||
clk->set_mode = dummy_timer_set_mode;
|
||||
clk->broadcast = smp_timer_broadcast;
|
||||
clk->cpumask = cpumask_of_cpu(cpu);
|
||||
clk->cpumask = cpumask_of(cpu);
|
||||
|
||||
clockevents_register_device(clk);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ static int tmu_timer_init(void)
|
||||
tmu0_clockevent.min_delta_ns =
|
||||
clockevent_delta2ns(1, &tmu0_clockevent);
|
||||
|
||||
tmu0_clockevent.cpumask = cpumask_of_cpu(0);
|
||||
tmu0_clockevent.cpumask = cpumask_of(0);
|
||||
|
||||
clockevents_register_device(&tmu0_clockevent);
|
||||
|
||||
|
@ -763,7 +763,7 @@ void __devinit setup_sparc64_timer(void)
|
||||
sevt = &__get_cpu_var(sparc64_events);
|
||||
|
||||
memcpy(sevt, &sparc64_clockevent, sizeof(*sevt));
|
||||
sevt->cpumask = cpumask_of_cpu(smp_processor_id());
|
||||
sevt->cpumask = cpumask_of(smp_processor_id());
|
||||
|
||||
clockevents_register_device(sevt);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ static int itimer_next_event(unsigned long delta,
|
||||
static struct clock_event_device itimer_clockevent = {
|
||||
.name = "itimer",
|
||||
.rating = 250,
|
||||
.cpumask = CPU_MASK_ALL,
|
||||
.cpumask = cpu_all_mask,
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
|
||||
.set_mode = itimer_set_mode,
|
||||
.set_next_event = itimer_next_event,
|
||||
|
@ -141,7 +141,7 @@ static int lapic_next_event(unsigned long delta,
|
||||
struct clock_event_device *evt);
|
||||
static void lapic_timer_setup(enum clock_event_mode mode,
|
||||
struct clock_event_device *evt);
|
||||
static void lapic_timer_broadcast(cpumask_t mask);
|
||||
static void lapic_timer_broadcast(const struct cpumask *mask);
|
||||
static void apic_pm_activate(void);
|
||||
|
||||
/*
|
||||
@ -453,10 +453,10 @@ static void lapic_timer_setup(enum clock_event_mode mode,
|
||||
/*
|
||||
* Local APIC timer broadcast function
|
||||
*/
|
||||
static void lapic_timer_broadcast(cpumask_t mask)
|
||||
static void lapic_timer_broadcast(const struct cpumask *mask)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
|
||||
send_IPI_mask(*mask, LOCAL_TIMER_VECTOR);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ static void __cpuinit setup_APIC_timer(void)
|
||||
struct clock_event_device *levt = &__get_cpu_var(lapic_events);
|
||||
|
||||
memcpy(levt, &lapic_clockevent, sizeof(*levt));
|
||||
levt->cpumask = cpumask_of_cpu(smp_processor_id());
|
||||
levt->cpumask = cpumask_of(smp_processor_id());
|
||||
|
||||
clockevents_register_device(levt);
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ static void hpet_legacy_clockevent_register(void)
|
||||
* Start hpet with the boot cpu mask and make it
|
||||
* global after the IO_APIC has been initialized.
|
||||
*/
|
||||
hpet_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
|
||||
hpet_clockevent.cpumask = cpumask_of(smp_processor_id());
|
||||
clockevents_register_device(&hpet_clockevent);
|
||||
global_clock_event = &hpet_clockevent;
|
||||
printk(KERN_DEBUG "hpet clockevent registered\n");
|
||||
@ -500,7 +500,7 @@ static void init_one_hpet_msi_clockevent(struct hpet_dev *hdev, int cpu)
|
||||
/* 5 usec minimum reprogramming delta. */
|
||||
evt->min_delta_ns = 5000;
|
||||
|
||||
evt->cpumask = cpumask_of_cpu(hdev->cpu);
|
||||
evt->cpumask = cpumask_of(hdev->cpu);
|
||||
clockevents_register_device(evt);
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ void __init setup_pit_timer(void)
|
||||
* Start pit with the boot cpu mask and make it global after the
|
||||
* IO_APIC has been initialized.
|
||||
*/
|
||||
pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
|
||||
pit_clockevent.cpumask = cpumask_of(smp_processor_id());
|
||||
pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
|
||||
pit_clockevent.shift);
|
||||
pit_clockevent.max_delta_ns =
|
||||
|
@ -287,7 +287,7 @@ static struct clock_event_device mfgpt_clockevent = {
|
||||
.set_mode = mfgpt_set_mode,
|
||||
.set_next_event = mfgpt_next_event,
|
||||
.rating = 250,
|
||||
.cpumask = CPU_MASK_ALL,
|
||||
.cpumask = cpu_all_mask,
|
||||
.shift = 32
|
||||
};
|
||||
|
||||
|
@ -226,7 +226,7 @@ static void __devinit vmi_time_init_clockevent(void)
|
||||
/* Upper bound is clockevent's use of ulong for cycle deltas. */
|
||||
evt->max_delta_ns = clockevent_delta2ns(ULONG_MAX, evt);
|
||||
evt->min_delta_ns = clockevent_delta2ns(1, evt);
|
||||
evt->cpumask = cpumask_of_cpu(cpu);
|
||||
evt->cpumask = cpumask_of(cpu);
|
||||
|
||||
printk(KERN_WARNING "vmi: registering clock event %s. mult=%lu shift=%u\n",
|
||||
evt->name, evt->mult, evt->shift);
|
||||
|
@ -737,7 +737,7 @@ static void lguest_time_init(void)
|
||||
|
||||
/* We can't set cpumask in the initializer: damn C limitations! Set it
|
||||
* here and register our timer device. */
|
||||
lguest_clockevent.cpumask = cpumask_of_cpu(0);
|
||||
lguest_clockevent.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&lguest_clockevent);
|
||||
|
||||
/* Finally, we unblock the timer interrupt. */
|
||||
|
@ -437,7 +437,7 @@ void xen_setup_timer(int cpu)
|
||||
evt = &per_cpu(xen_clock_events, cpu);
|
||||
memcpy(evt, xen_clockevent, sizeof(*evt));
|
||||
|
||||
evt->cpumask = cpumask_of_cpu(cpu);
|
||||
evt->cpumask = cpumask_of(cpu);
|
||||
evt->irq = irq;
|
||||
|
||||
setup_runstate_info(cpu);
|
||||
|
@ -154,7 +154,6 @@ static struct tc_clkevt_device clkevt = {
|
||||
.shift = 32,
|
||||
/* Should be lower than at91rm9200's system timer */
|
||||
.rating = 125,
|
||||
.cpumask = CPU_MASK_CPU0,
|
||||
.set_next_event = tc_next_event,
|
||||
.set_mode = tc_mode,
|
||||
},
|
||||
@ -195,6 +194,7 @@ static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)
|
||||
clkevt.clkevt.max_delta_ns
|
||||
= clockevent_delta2ns(0xffff, &clkevt.clkevt);
|
||||
clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1;
|
||||
clkevt.clkevt.cpumask = cpumask_of(0);
|
||||
|
||||
setup_irq(irq, &tc_irqaction);
|
||||
|
||||
|
@ -82,13 +82,13 @@ struct clock_event_device {
|
||||
int shift;
|
||||
int rating;
|
||||
int irq;
|
||||
cpumask_t cpumask;
|
||||
const struct cpumask *cpumask;
|
||||
int (*set_next_event)(unsigned long evt,
|
||||
struct clock_event_device *);
|
||||
void (*set_mode)(enum clock_event_mode mode,
|
||||
struct clock_event_device *);
|
||||
void (*event_handler)(struct clock_event_device *);
|
||||
void (*broadcast)(cpumask_t mask);
|
||||
void (*broadcast)(const struct cpumask *mask);
|
||||
struct list_head list;
|
||||
enum clock_event_mode mode;
|
||||
ktime_t next_event;
|
||||
|
@ -166,6 +166,8 @@ static void clockevents_notify_released(void)
|
||||
void clockevents_register_device(struct clock_event_device *dev)
|
||||
{
|
||||
BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
|
||||
BUG_ON(!dev->cpumask);
|
||||
|
||||
/*
|
||||
* A nsec2cyc multiplicator of 0 is invalid and we'd crash
|
||||
* on it, so fix it up and emit a warning:
|
||||
|
@ -150,7 +150,7 @@ static void tick_do_broadcast(cpumask_t mask)
|
||||
*/
|
||||
cpu = first_cpu(mask);
|
||||
td = &per_cpu(tick_cpu_device, cpu);
|
||||
td->evtdev->broadcast(mask);
|
||||
td->evtdev->broadcast(&mask);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ static void tick_setup_device(struct tick_device *td,
|
||||
* When the device is not per cpu, pin the interrupt to the
|
||||
* current cpu:
|
||||
*/
|
||||
if (!cpumask_equal(&newdev->cpumask, cpumask))
|
||||
if (!cpumask_equal(newdev->cpumask, cpumask))
|
||||
irq_set_affinity(newdev->irq, cpumask);
|
||||
|
||||
/*
|
||||
@ -202,14 +202,14 @@ static int tick_check_new_device(struct clock_event_device *newdev)
|
||||
spin_lock_irqsave(&tick_device_lock, flags);
|
||||
|
||||
cpu = smp_processor_id();
|
||||
if (!cpu_isset(cpu, newdev->cpumask))
|
||||
if (!cpumask_test_cpu(cpu, newdev->cpumask))
|
||||
goto out_bc;
|
||||
|
||||
td = &per_cpu(tick_cpu_device, cpu);
|
||||
curdev = td->evtdev;
|
||||
|
||||
/* cpu local device ? */
|
||||
if (!cpus_equal(newdev->cpumask, cpumask_of_cpu(cpu))) {
|
||||
if (!cpumask_equal(newdev->cpumask, cpumask_of(cpu))) {
|
||||
|
||||
/*
|
||||
* If the cpu affinity of the device interrupt can not
|
||||
@ -222,7 +222,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)
|
||||
* If we have a cpu local device already, do not replace it
|
||||
* by a non cpu local device
|
||||
*/
|
||||
if (curdev && cpus_equal(curdev->cpumask, cpumask_of_cpu(cpu)))
|
||||
if (curdev && cpumask_equal(curdev->cpumask, cpumask_of(cpu)))
|
||||
goto out_bc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user