diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-06-04 17:06:36 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-06-10 08:43:34 -0400 |
commit | 31620a198cf6891dfdf5477607621da9aa092380 (patch) | |
tree | fcaca494e495776da571dc21d905ec82b56c8e4f /arch/x86/xen | |
parent | 354e7b761992a8e3923badaf705c4acbb9d5659d (diff) |
xen/time: Encapsulate the struct clock_event_device in another structure.
We don't do any code movement. We just encapsulate the struct clock_event_device
in a new structure which contains said structure and a pointer to
a char *name. The 'name' will be used in 'xen/time: Don't leak interrupt
name when offlining'.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/time.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 3d88bfdf9e1c..5190687ca569 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -377,11 +377,16 @@ static const struct clock_event_device xen_vcpuop_clockevent = { | |||
377 | 377 | ||
378 | static const struct clock_event_device *xen_clockevent = | 378 | static const struct clock_event_device *xen_clockevent = |
379 | &xen_timerop_clockevent; | 379 | &xen_timerop_clockevent; |
380 | static DEFINE_PER_CPU(struct clock_event_device, xen_clock_events) = { .irq = -1 }; | 380 | |
381 | struct xen_clock_event_device { | ||
382 | struct clock_event_device evt; | ||
383 | char *name; | ||
384 | }; | ||
385 | static DEFINE_PER_CPU(struct xen_clock_event_device, xen_clock_events) = { .evt.irq = -1 }; | ||
381 | 386 | ||
382 | static irqreturn_t xen_timer_interrupt(int irq, void *dev_id) | 387 | static irqreturn_t xen_timer_interrupt(int irq, void *dev_id) |
383 | { | 388 | { |
384 | struct clock_event_device *evt = &__get_cpu_var(xen_clock_events); | 389 | struct clock_event_device *evt = &__get_cpu_var(xen_clock_events).evt; |
385 | irqreturn_t ret; | 390 | irqreturn_t ret; |
386 | 391 | ||
387 | ret = IRQ_NONE; | 392 | ret = IRQ_NONE; |
@@ -401,7 +406,7 @@ void xen_setup_timer(int cpu) | |||
401 | struct clock_event_device *evt; | 406 | struct clock_event_device *evt; |
402 | int irq; | 407 | int irq; |
403 | 408 | ||
404 | evt = &per_cpu(xen_clock_events, cpu); | 409 | evt = &per_cpu(xen_clock_events, cpu).evt; |
405 | WARN(evt->irq >= 0, "IRQ%d for CPU%d is already allocated\n", evt->irq, cpu); | 410 | WARN(evt->irq >= 0, "IRQ%d for CPU%d is already allocated\n", evt->irq, cpu); |
406 | 411 | ||
407 | printk(KERN_INFO "installing Xen timer for CPU %d\n", cpu); | 412 | printk(KERN_INFO "installing Xen timer for CPU %d\n", cpu); |
@@ -426,7 +431,7 @@ void xen_teardown_timer(int cpu) | |||
426 | { | 431 | { |
427 | struct clock_event_device *evt; | 432 | struct clock_event_device *evt; |
428 | BUG_ON(cpu == 0); | 433 | BUG_ON(cpu == 0); |
429 | evt = &per_cpu(xen_clock_events, cpu); | 434 | evt = &per_cpu(xen_clock_events, cpu).evt; |
430 | unbind_from_irqhandler(evt->irq, NULL); | 435 | unbind_from_irqhandler(evt->irq, NULL); |
431 | evt->irq = -1; | 436 | evt->irq = -1; |
432 | } | 437 | } |
@@ -435,7 +440,7 @@ void xen_setup_cpu_clockevents(void) | |||
435 | { | 440 | { |
436 | BUG_ON(preemptible()); | 441 | BUG_ON(preemptible()); |
437 | 442 | ||
438 | clockevents_register_device(&__get_cpu_var(xen_clock_events)); | 443 | clockevents_register_device(&__get_cpu_var(xen_clock_events).evt); |
439 | } | 444 | } |
440 | 445 | ||
441 | void xen_timer_resume(void) | 446 | void xen_timer_resume(void) |