diff options
author | Anton Blanchard <anton@samba.org> | 2005-09-11 23:12:11 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-12 03:19:12 -0400 |
commit | 26370322d8e3504db61cb8d438a9fca3b87ac0db (patch) | |
tree | bbc4d87cea4a30010e4ef1913df948470504ffd6 /arch/ppc64 | |
parent | fd9648dff6f9797ecc509bcd181706a274dc074d (diff) |
[PATCH] ppc64: xics cleanup
A few xics cleanups:
- Make some things static.
- Be more consistent with error printing - interrupts are unsigned,
error values are signed.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/xics.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c index d9dc6f28d050..daf93885dcfa 100644 --- a/arch/ppc64/kernel/xics.c +++ b/arch/ppc64/kernel/xics.c | |||
@@ -38,7 +38,7 @@ static void xics_mask_and_ack_irq(unsigned int irq); | |||
38 | static void xics_end_irq(unsigned int irq); | 38 | static void xics_end_irq(unsigned int irq); |
39 | static void xics_set_affinity(unsigned int irq_nr, cpumask_t cpumask); | 39 | static void xics_set_affinity(unsigned int irq_nr, cpumask_t cpumask); |
40 | 40 | ||
41 | struct hw_interrupt_type xics_pic = { | 41 | static struct hw_interrupt_type xics_pic = { |
42 | .typename = " XICS ", | 42 | .typename = " XICS ", |
43 | .startup = xics_startup, | 43 | .startup = xics_startup, |
44 | .enable = xics_enable_irq, | 44 | .enable = xics_enable_irq, |
@@ -48,7 +48,7 @@ struct hw_interrupt_type xics_pic = { | |||
48 | .set_affinity = xics_set_affinity | 48 | .set_affinity = xics_set_affinity |
49 | }; | 49 | }; |
50 | 50 | ||
51 | struct hw_interrupt_type xics_8259_pic = { | 51 | static struct hw_interrupt_type xics_8259_pic = { |
52 | .typename = " XICS/8259", | 52 | .typename = " XICS/8259", |
53 | .ack = xics_mask_and_ack_irq, | 53 | .ack = xics_mask_and_ack_irq, |
54 | }; | 54 | }; |
@@ -89,9 +89,8 @@ static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS]; | |||
89 | static int xics_irq_8259_cascade = 0; | 89 | static int xics_irq_8259_cascade = 0; |
90 | static int xics_irq_8259_cascade_real = 0; | 90 | static int xics_irq_8259_cascade_real = 0; |
91 | static unsigned int default_server = 0xFF; | 91 | static unsigned int default_server = 0xFF; |
92 | /* also referenced in smp.c... */ | 92 | static unsigned int default_distrib_server = 0; |
93 | unsigned int default_distrib_server = 0; | 93 | static unsigned int interrupt_server_size = 8; |
94 | unsigned int interrupt_server_size = 8; | ||
95 | 94 | ||
96 | /* | 95 | /* |
97 | * XICS only has a single IPI, so encode the messages per CPU | 96 | * XICS only has a single IPI, so encode the messages per CPU |
@@ -99,10 +98,10 @@ unsigned int interrupt_server_size = 8; | |||
99 | struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; | 98 | struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; |
100 | 99 | ||
101 | /* RTAS service tokens */ | 100 | /* RTAS service tokens */ |
102 | int ibm_get_xive; | 101 | static int ibm_get_xive; |
103 | int ibm_set_xive; | 102 | static int ibm_set_xive; |
104 | int ibm_int_on; | 103 | static int ibm_int_on; |
105 | int ibm_int_off; | 104 | static int ibm_int_off; |
106 | 105 | ||
107 | typedef struct { | 106 | typedef struct { |
108 | int (*xirr_info_get)(int cpu); | 107 | int (*xirr_info_get)(int cpu); |
@@ -284,16 +283,17 @@ static void xics_enable_irq(unsigned int virq) | |||
284 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, | 283 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, |
285 | DEFAULT_PRIORITY); | 284 | DEFAULT_PRIORITY); |
286 | if (call_status != 0) { | 285 | if (call_status != 0) { |
287 | printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_set_xive " | 286 | printk(KERN_ERR "xics_enable_irq: irq=%u: ibm_set_xive " |
288 | "returned %x\n", irq, call_status); | 287 | "returned %d\n", irq, call_status); |
288 | printk("set_xive %x, server %x\n", ibm_set_xive, server); | ||
289 | return; | 289 | return; |
290 | } | 290 | } |
291 | 291 | ||
292 | /* Now unmask the interrupt (often a no-op) */ | 292 | /* Now unmask the interrupt (often a no-op) */ |
293 | call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq); | 293 | call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq); |
294 | if (call_status != 0) { | 294 | if (call_status != 0) { |
295 | printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_int_on " | 295 | printk(KERN_ERR "xics_enable_irq: irq=%u: ibm_int_on " |
296 | "returned %x\n", irq, call_status); | 296 | "returned %d\n", irq, call_status); |
297 | return; | 297 | return; |
298 | } | 298 | } |
299 | } | 299 | } |
@@ -308,8 +308,8 @@ static void xics_disable_real_irq(unsigned int irq) | |||
308 | 308 | ||
309 | call_status = rtas_call(ibm_int_off, 1, 1, NULL, irq); | 309 | call_status = rtas_call(ibm_int_off, 1, 1, NULL, irq); |
310 | if (call_status != 0) { | 310 | if (call_status != 0) { |
311 | printk(KERN_ERR "xics_disable_real_irq: irq=%d: " | 311 | printk(KERN_ERR "xics_disable_real_irq: irq=%u: " |
312 | "ibm_int_off returned %x\n", irq, call_status); | 312 | "ibm_int_off returned %d\n", irq, call_status); |
313 | return; | 313 | return; |
314 | } | 314 | } |
315 | 315 | ||
@@ -317,8 +317,8 @@ static void xics_disable_real_irq(unsigned int irq) | |||
317 | /* Have to set XIVE to 0xff to be able to remove a slot */ | 317 | /* Have to set XIVE to 0xff to be able to remove a slot */ |
318 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 0xff); | 318 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 0xff); |
319 | if (call_status != 0) { | 319 | if (call_status != 0) { |
320 | printk(KERN_ERR "xics_disable_irq: irq=%d: ibm_set_xive(0xff)" | 320 | printk(KERN_ERR "xics_disable_irq: irq=%u: ibm_set_xive(0xff)" |
321 | " returned %x\n", irq, call_status); | 321 | " returned %d\n", irq, call_status); |
322 | return; | 322 | return; |
323 | } | 323 | } |
324 | } | 324 | } |
@@ -380,7 +380,7 @@ int xics_get_irq(struct pt_regs *regs) | |||
380 | if (irq == NO_IRQ) | 380 | if (irq == NO_IRQ) |
381 | irq = real_irq_to_virt_slowpath(vec); | 381 | irq = real_irq_to_virt_slowpath(vec); |
382 | if (irq == NO_IRQ) { | 382 | if (irq == NO_IRQ) { |
383 | printk(KERN_ERR "Interrupt %d (real) is invalid," | 383 | printk(KERN_ERR "Interrupt %u (real) is invalid," |
384 | " disabling it.\n", vec); | 384 | " disabling it.\n", vec); |
385 | xics_disable_real_irq(vec); | 385 | xics_disable_real_irq(vec); |
386 | } else | 386 | } else |
@@ -622,7 +622,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) | |||
622 | status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); | 622 | status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); |
623 | 623 | ||
624 | if (status) { | 624 | if (status) { |
625 | printk(KERN_ERR "xics_set_affinity: irq=%d ibm,get-xive " | 625 | printk(KERN_ERR "xics_set_affinity: irq=%u ibm,get-xive " |
626 | "returns %d\n", irq, status); | 626 | "returns %d\n", irq, status); |
627 | return; | 627 | return; |
628 | } | 628 | } |
@@ -641,7 +641,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) | |||
641 | irq, newmask, xics_status[1]); | 641 | irq, newmask, xics_status[1]); |
642 | 642 | ||
643 | if (status) { | 643 | if (status) { |
644 | printk(KERN_ERR "xics_set_affinity: irq=%d ibm,set-xive " | 644 | printk(KERN_ERR "xics_set_affinity: irq=%u ibm,set-xive " |
645 | "returns %d\n", irq, status); | 645 | "returns %d\n", irq, status); |
646 | return; | 646 | return; |
647 | } | 647 | } |
@@ -720,7 +720,7 @@ void xics_migrate_irqs_away(void) | |||
720 | 720 | ||
721 | status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); | 721 | status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); |
722 | if (status) { | 722 | if (status) { |
723 | printk(KERN_ERR "migrate_irqs_away: irq=%d " | 723 | printk(KERN_ERR "migrate_irqs_away: irq=%u " |
724 | "ibm,get-xive returns %d\n", | 724 | "ibm,get-xive returns %d\n", |
725 | virq, status); | 725 | virq, status); |
726 | goto unlock; | 726 | goto unlock; |
@@ -734,7 +734,7 @@ void xics_migrate_irqs_away(void) | |||
734 | if (xics_status[0] != get_hard_smp_processor_id(cpu)) | 734 | if (xics_status[0] != get_hard_smp_processor_id(cpu)) |
735 | goto unlock; | 735 | goto unlock; |
736 | 736 | ||
737 | printk(KERN_WARNING "IRQ %d affinity broken off cpu %u\n", | 737 | printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n", |
738 | virq, cpu); | 738 | virq, cpu); |
739 | 739 | ||
740 | /* Reset affinity to all cpus */ | 740 | /* Reset affinity to all cpus */ |