]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/kernel.h
printk_ratelimit() functions should use CONFIG_PRINTK
[linux-2.6-omap-h63xx.git] / include / linux / kernel.h
index 5fdbc814c2eb73ad5330be18348cee1a629210f9..8f28d35867f862c3bdb9242356428801f957469e 100644 (file)
@@ -35,7 +35,7 @@ extern const char linux_proc_banner[];
 #define ALIGN(x,a)             __ALIGN_MASK(x,(typeof(x))(a)-1)
 #define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))
 #define PTR_ALIGN(p, a)                ((typeof(p))ALIGN((unsigned long)(p), (a)))
-#define IS_ALIGNED(x,a)                (((x) % ((typeof(x))(a))) == 0)
+#define IS_ALIGNED(x, a)               (((x) & ((typeof(x))(a) - 1)) == 0)
 
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
 
@@ -76,6 +76,13 @@ extern const char linux_proc_banner[];
 #define        KERN_INFO       "<6>"   /* informational                        */
 #define        KERN_DEBUG      "<7>"   /* debug-level messages                 */
 
+/*
+ * Annotation for a "continued" line of log printout (only done after a
+ * line that had no enclosing \n). Only to be used by core/arch code
+ * during early bootup (a continued line is not SMP-safe otherwise).
+ */
+#define        KERN_CONT       ""
+
 extern int console_printk[];
 
 #define console_loglevel (console_printk[0])
@@ -98,8 +105,8 @@ struct user;
  * supposed to.
  */
 #ifdef CONFIG_PREEMPT_VOLUNTARY
-extern int cond_resched(void);
-# define might_resched() cond_resched()
+extern int _cond_resched(void);
+# define might_resched() _cond_resched()
 #else
 # define might_resched() do { } while (0)
 #endif
@@ -126,7 +133,7 @@ NORET_TYPE void panic(const char * fmt, ...)
 extern void oops_enter(void);
 extern void oops_exit(void);
 extern int oops_may_print(void);
-fastcall NORET_TYPE void do_exit(long error_code)
+NORET_TYPE void do_exit(long error_code)
        ATTRIB_NORET;
 NORET_TYPE void complete_and_exit(struct completion *, long)
        ATTRIB_NORET;
@@ -165,13 +172,21 @@ extern int kernel_text_address(unsigned long addr);
 struct pid;
 extern struct pid *session_of_pgrp(struct pid *pgrp);
 
-extern void dump_thread(struct pt_regs *regs, struct user *dump);
-
 #ifdef CONFIG_PRINTK
 asmlinkage int vprintk(const char *fmt, va_list args)
        __attribute__ ((format (printf, 1, 0)));
 asmlinkage int printk(const char * fmt, ...)
        __attribute__ ((format (printf, 1, 2))) __cold;
+extern int log_buf_get_len(void);
+extern int log_buf_read(int idx);
+extern int log_buf_copy(char *dest, int idx, int len);
+
+extern int printk_ratelimit_jiffies;
+extern int printk_ratelimit_burst;
+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);
 #else
 static inline int vprintk(const char *s, va_list args)
        __attribute__ ((format (printf, 1, 0)));
@@ -179,14 +194,21 @@ static inline int vprintk(const char *s, va_list args) { return 0; }
 static inline int printk(const char *s, ...)
        __attribute__ ((format (printf, 1, 2)));
 static inline int __cold printk(const char *s, ...) { return 0; }
+static inline int log_buf_get_len(void) { return 0; }
+static inline int log_buf_read(int idx) { return 0; }
+static inline int log_buf_copy(char *dest, int idx, int len) { return 0; }
+static inline int printk_ratelimit(void) { return 0; }
+static inline int __printk_ratelimit(int ratelimit_jiffies, \
+                                    int ratelimit_burst) { return 0; }
+static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
+                                         unsigned int interval_msec)   \
+               { return false; }
 #endif
 
-unsigned long int_sqrt(unsigned long);
+extern void __attribute__((format(printf, 1, 2)))
+       early_printk(const char *fmt, ...);
 
-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);
+unsigned long int_sqrt(unsigned long);
 
 static inline void console_silent(void)
 {
@@ -208,6 +230,7 @@ extern int panic_on_unrecovered_nmi;
 extern int tainted;
 extern const char *print_tainted(void);
 extern void add_taint(unsigned);
+extern int root_mountflags;
 
 /* Values used for system_state */
 extern enum system_states {
@@ -227,6 +250,7 @@ extern enum system_states {
 #define TAINT_BAD_PAGE                 (1<<5)
 #define TAINT_USER                     (1<<6)
 #define TAINT_DIE                      (1<<7)
+#define TAINT_OVERRIDDEN_ACPI_TABLE    (1<<8)
 
 extern void dump_stack(void) __cold;
 
@@ -245,10 +269,25 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
                        const void *buf, size_t len);
 #define hex_asc(x)     "0123456789abcdef"[x]
 
+#define pr_emerg(fmt, arg...) \
+       printk(KERN_EMERG fmt, ##arg)
+#define pr_alert(fmt, arg...) \
+       printk(KERN_ALERT fmt, ##arg)
+#define pr_crit(fmt, arg...) \
+       printk(KERN_CRIT fmt, ##arg)
+#define pr_err(fmt, arg...) \
+       printk(KERN_ERR fmt, ##arg)
+#define pr_warning(fmt, arg...) \
+       printk(KERN_WARNING fmt, ##arg)
+#define pr_notice(fmt, arg...) \
+       printk(KERN_NOTICE fmt, ##arg)
+#define pr_info(fmt, arg...) \
+       printk(KERN_INFO fmt, ##arg)
+
 #ifdef DEBUG
 /* If you are writing a driver, please use dev_dbg instead */
-#define pr_debug(fmt,arg...) \
-       printk(KERN_DEBUG fmt,##arg)
+#define pr_debug(fmt, arg...) \
+       printk(KERN_DEBUG fmt, ##arg)
 #else
 static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
 {
@@ -256,9 +295,6 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char *
 }
 #endif
 
-#define pr_info(fmt,arg...) \
-       printk(KERN_INFO fmt,##arg)
-
 /*
  *      Display an IP address in readable format.
  */