Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.17-pre8 /kernel/printk.c

Filename:/kernel/printk.c
Lines Added:13
Lines Deleted:0
Also changed in: (Previous) 2.4.15-greased-turkey  2.4.15-pre9  2.4.15-pre8  2.4.15-pre7  2.4.15-pre6  2.4.15-pre5 
(Following) 2.4.17-rc1  2.4.17-rc2  2.4.17  2.4.18pre1  2.4.18pre2  2.4.18-pre3 

Location
[  2.4.17-pre8
  [  kernel
     o  printk.c

Patch

diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.16/kernel/printk.c linux/kernel/printk.c
--- linux-2.4.16/kernel/printk.c   Mon Nov 26 10:35:00 2001
+++ linux/kernel/printk.c   Mon Dec 10 17:05:24 2001
@@ -38,6 +38,10 @@
 
 #define LOG_BUF_MASK   (LOG_BUF_LEN-1)
 
+#ifndef arch_consoles_callable
+#define arch_consoles_callable() (1)
+#endif
+
 /* printk's without a loglevel use this.. */
 #define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
 
@@ -438,6 +442,14 @@
          log_level_unknown = 1;
    }
 
+   if (!arch_consoles_callable()) {
+      /*
+       * On some architectures, the consoles are not usable
+       * on secondary CPUs early in the boot process.
+       */
+      spin_unlock_irqrestore(&logbuf_lock, flags);
+      goto out;
+   }
    if (!down_trylock(&console_sem)) {
       /*
        * We own the drivers.  We can drop the spinlock and let
@@ -454,6 +466,7 @@
        */
       spin_unlock_irqrestore(&logbuf_lock, flags);
    }
+out:
    return printed_len;
 }
 EXPORT_SYMBOL(printk);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.