aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-05-08 00:27:17 -0400
committerPaul Mackerras <paulus@samba.org>2008-05-14 08:31:57 -0400
commit1c8950ff87de950a3b6ccfb26650fc0a56278836 (patch)
tree6491e5a9148fd8e4d275faf725f490065b007715
parent9f1067c2d98ac1c43f0c82892f5647774a6ac759 (diff)
[POWERPC] Make cpus_in_xmon static and remove extern mess from hvc_console.c
This is a little messier than I'd like because xmon.h only exists on powerpc and we can't have a static inline and an extern declaration visible at the same time. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/xmon/xmon.c7
-rw-r--r--drivers/char/hvc_console.c8
-rw-r--r--drivers/char/hvc_console.h10
-rw-r--r--include/asm-powerpc/xmon.h4
4 files changed, 21 insertions, 8 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 95f24c9822b1..6726da07c065 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -54,7 +54,7 @@
54#define skipbl xmon_skipbl 54#define skipbl xmon_skipbl
55 55
56#ifdef CONFIG_SMP 56#ifdef CONFIG_SMP
57cpumask_t cpus_in_xmon = CPU_MASK_NONE; 57static cpumask_t cpus_in_xmon = CPU_MASK_NONE;
58static unsigned long xmon_taken = 1; 58static unsigned long xmon_taken = 1;
59static int xmon_owner; 59static int xmon_owner;
60static int xmon_gate; 60static int xmon_gate;
@@ -327,6 +327,11 @@ static void release_output_lock(void)
327{ 327{
328 xmon_speaker = 0; 328 xmon_speaker = 0;
329} 329}
330
331int cpus_are_in_xmon(void)
332{
333 return !cpus_empty(cpus_in_xmon);
334}
330#endif 335#endif
331 336
332static int xmon_core(struct pt_regs *regs, int fromipi) 337static int xmon_core(struct pt_regs *regs, int fromipi)
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 44160d5ebca0..2f9759d625cc 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -675,12 +675,6 @@ static int hvc_poll(struct hvc_struct *hp)
675 return poll_mask; 675 return poll_mask;
676} 676}
677 677
678#if defined(CONFIG_XMON) && defined(CONFIG_SMP)
679extern cpumask_t cpus_in_xmon;
680#else
681static const cpumask_t cpus_in_xmon = CPU_MASK_NONE;
682#endif
683
684/* 678/*
685 * This kthread is either polling or interrupt driven. This is determined by 679 * This kthread is either polling or interrupt driven. This is determined by
686 * calling hvc_poll() who determines whether a console adapter support 680 * calling hvc_poll() who determines whether a console adapter support
@@ -698,7 +692,7 @@ static int khvcd(void *unused)
698 hvc_kicked = 0; 692 hvc_kicked = 0;
699 try_to_freeze(); 693 try_to_freeze();
700 wmb(); 694 wmb();
701 if (cpus_empty(cpus_in_xmon)) { 695 if (!cpus_are_in_xmon()) {
702 spin_lock(&hvc_structs_lock); 696 spin_lock(&hvc_structs_lock);
703 list_for_each_entry(hp, &hvc_structs, next) { 697 list_for_each_entry(hp, &hvc_structs, next) {
704 poll_mask |= hvc_poll(hp); 698 poll_mask |= hvc_poll(hp);
diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h
index 8c59818050e6..42ffb17e15df 100644
--- a/drivers/char/hvc_console.h
+++ b/drivers/char/hvc_console.h
@@ -60,4 +60,14 @@ extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq,
60/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */ 60/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */
61extern int __devexit hvc_remove(struct hvc_struct *hp); 61extern int __devexit hvc_remove(struct hvc_struct *hp);
62 62
63
64#if defined(CONFIG_XMON) && defined(CONFIG_SMP)
65#include <asm/xmon.h>
66#else
67static inline int cpus_are_in_xmon(void)
68{
69 return 0;
70}
71#endif
72
63#endif // HVC_CONSOLE_H 73#endif // HVC_CONSOLE_H
diff --git a/include/asm-powerpc/xmon.h b/include/asm-powerpc/xmon.h
index d83da3cbd085..5eb8e599e5cc 100644
--- a/include/asm-powerpc/xmon.h
+++ b/include/asm-powerpc/xmon.h
@@ -25,5 +25,9 @@ static inline void xmon_setup(void) { };
25static inline void xmon_register_spus(struct list_head *list) { }; 25static inline void xmon_register_spus(struct list_head *list) { };
26#endif 26#endif
27 27
28#if defined(CONFIG_XMON) && defined(CONFIG_SMP)
29extern int cpus_are_in_xmon(void);
30#endif
31
28#endif /* __KERNEL __ */ 32#endif /* __KERNEL __ */
29#endif /* __ASM_POWERPC_XMON_H */ 33#endif /* __ASM_POWERPC_XMON_H */