]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/kernel.h
[PATCH] Extract and use wake_up_klogd()
[linux-2.6.git] / include / linux / kernel.h
index 80f39cab470a2800abd64994341f2daca6c66678..e91dce75bbcc74ecdf905b897ccced8a090c0063 100644 (file)
 #include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/bitops.h>
+#include <linux/log2.h>
 #include <asm/byteorder.h>
 #include <asm/bug.h>
 
 extern const char linux_banner[];
+extern const char linux_proc_banner[];
 
 #define INT_MAX                ((int)(~0U>>1))
 #define INT_MIN                (-INT_MAX - 1)
@@ -30,8 +32,10 @@ extern const char linux_banner[];
 
 #define STACK_MAGIC    0xdeadbeef
 
+#define ALIGN(x,a)             __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))
+
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
 #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
@@ -63,7 +67,7 @@ struct user;
  * context (spinlock, irq-handler, ...).
  *
  * This is a useful debugging help to be able to catch problems early and not
- * be biten later when the calling function happens to sleep when it is not
+ * be bitten later when the calling function happens to sleep when it is not
  * supposed to.
  */
 #ifdef CONFIG_PREEMPT_VOLUNTARY
@@ -155,22 +159,10 @@ static inline int printk(const char *s, ...) { return 0; }
 
 unsigned long int_sqrt(unsigned long);
 
-static inline int __attribute_pure__ long_log2(unsigned long x)
-{
-       int r = 0;
-       for (x >>= 1; x > 0; x >>= 1)
-               r++;
-       return r;
-}
-
-static inline unsigned long
-__attribute_const__ roundup_pow_of_two(unsigned long x)
-{
-       return 1UL << fls_long(x - 1);
-}
-
 extern int printk_ratelimit(void);
 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
+extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
+                               unsigned int interval_msec);
 
 static inline void console_silent(void)
 {
@@ -184,6 +176,7 @@ static inline void console_verbose(void)
 }
 
 extern void bust_spinlocks(int yes);
+extern void wake_up_klogd(void);
 extern int oops_in_progress;           /* If set, an oops, panic(), BUG() or die() is in progress */
 extern int panic_timeout;
 extern int panic_on_oops;
@@ -208,6 +201,7 @@ extern enum system_states {
 #define TAINT_FORCED_RMMOD             (1<<3)
 #define TAINT_MACHINE_CHECK            (1<<4)
 #define TAINT_BAD_PAGE                 (1<<5)
+#define TAINT_USER                     (1<<6)
 
 extern void dump_stack(void);
 
@@ -320,6 +314,9 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char *
        (void)__tmp; \
 })
 
+struct sysinfo;
+extern int do_sysinfo(struct sysinfo *info);
+
 #endif /* __KERNEL__ */
 
 #define SI_LOAD_SHIFT  16