cpus_in_xmon questions

Hollis Blanchard hollisb at us.ibm.com
Wed Aug 27 08:16:25 EST 2003


Hey, I noticed a build break with CONFIG_SMP off. cpus_in_xmon is only
defined if CONFIG_SMP is on... this is the fix.

--- drivers/char/hvc_console.c  26 Jun 2003 14:32:53 -0000      1.13
+++ drivers/char/hvc_console.c  26 Aug 2003 21:58:44 -0000
@@ -223,7 +223,7 @@
         spin_unlock_irqrestore(&hp->lock, flags);
  }

-#if defined (CONFIG_XMON)
+#if defined (CONFIG_XMON) && defined (CONFIG_SMP)
  extern unsigned long cpus_in_xmon;
  #else
  unsigned long cpus_in_xmon=0;

Also, what is cpus_in_xmon used for? In xmon/xmon.c, it looks like it's
used to prevent a CPU from recursively entering xmon. What could cause
that, and would an oops or some sort of message be better there? What
prevents a UP CPU from doing the same thing?

In hvc_console.c, if any CPU is in xmon, the thread skips polling for
any data. Why?

Also, the hvc_console.c cpus_in_xmon redefinition looks like a
code-cleanliness feature, but if it's made const the compiler will
optimize it out altogether:

--- drivers/char/hvc_console.c  26 Jun 2003 14:32:53 -0000      1.13
+++ drivers/char/hvc_console.c  26 Aug 2003 22:14:00 -0000
@@ -223,10 +223,10 @@
         spin_unlock_irqrestore(&hp->lock, flags);
  }

-#if defined (CONFIG_XMON)
+#if defined (CONFIG_XMON) && defined (CONFIG_SMP)
  extern unsigned long cpus_in_xmon;
  #else
-unsigned long cpus_in_xmon=0;
+const unsigned long cpus_in_xmon=0;
  #endif

--
Hollis Blanchard
IBM Linux Technology Center


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list