aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5fdbc814c2eb..94bc99656963 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -76,6 +76,13 @@ extern const char linux_proc_banner[];
76#define KERN_INFO "<6>" /* informational */ 76#define KERN_INFO "<6>" /* informational */
77#define KERN_DEBUG "<7>" /* debug-level messages */ 77#define KERN_DEBUG "<7>" /* debug-level messages */
78 78
79/*
80 * Annotation for a "continued" line of log printout (only done after a
81 * line that had no enclosing \n). Only to be used by core/arch code
82 * during early bootup (a continued line is not SMP-safe otherwise).
83 */
84#define KERN_CONT ""
85
79extern int console_printk[]; 86extern int console_printk[];
80 87
81#define console_loglevel (console_printk[0]) 88#define console_loglevel (console_printk[0])
@@ -172,6 +179,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
172 __attribute__ ((format (printf, 1, 0))); 179 __attribute__ ((format (printf, 1, 0)));
173asmlinkage int printk(const char * fmt, ...) 180asmlinkage int printk(const char * fmt, ...)
174 __attribute__ ((format (printf, 1, 2))) __cold; 181 __attribute__ ((format (printf, 1, 2))) __cold;
182extern int log_buf_get_len(void);
183extern int log_buf_read(int idx);
184extern int log_buf_copy(char *dest, int idx, int len);
175#else 185#else
176static inline int vprintk(const char *s, va_list args) 186static inline int vprintk(const char *s, va_list args)
177 __attribute__ ((format (printf, 1, 0))); 187 __attribute__ ((format (printf, 1, 0)));
@@ -179,6 +189,9 @@ static inline int vprintk(const char *s, va_list args) { return 0; }
179static inline int printk(const char *s, ...) 189static inline int printk(const char *s, ...)
180 __attribute__ ((format (printf, 1, 2))); 190 __attribute__ ((format (printf, 1, 2)));
181static inline int __cold printk(const char *s, ...) { return 0; } 191static inline int __cold printk(const char *s, ...) { return 0; }
192static inline int log_buf_get_len(void) { return 0; }
193static inline int log_buf_read(int idx) { return 0; }
194static inline int log_buf_copy(char *dest, int idx, int len) { return 0; }
182#endif 195#endif
183 196
184unsigned long int_sqrt(unsigned long); 197unsigned long int_sqrt(unsigned long);
@@ -245,10 +258,25 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
245 const void *buf, size_t len); 258 const void *buf, size_t len);
246#define hex_asc(x) "0123456789abcdef"[x] 259#define hex_asc(x) "0123456789abcdef"[x]
247 260
261#define pr_emerg(fmt, arg...) \
262 printk(KERN_EMERG fmt, ##arg)
263#define pr_alert(fmt, arg...) \
264 printk(KERN_ALERT fmt, ##arg)
265#define pr_crit(fmt, arg...) \
266 printk(KERN_CRIT fmt, ##arg)
267#define pr_err(fmt, arg...) \
268 printk(KERN_ERR fmt, ##arg)
269#define pr_warning(fmt, arg...) \
270 printk(KERN_WARNING fmt, ##arg)
271#define pr_notice(fmt, arg...) \
272 printk(KERN_NOTICE fmt, ##arg)
273#define pr_info(fmt, arg...) \
274 printk(KERN_INFO fmt, ##arg)
275
248#ifdef DEBUG 276#ifdef DEBUG
249/* If you are writing a driver, please use dev_dbg instead */ 277/* If you are writing a driver, please use dev_dbg instead */
250#define pr_debug(fmt,arg...) \ 278#define pr_debug(fmt, arg...) \
251 printk(KERN_DEBUG fmt,##arg) 279 printk(KERN_DEBUG fmt, ##arg)
252#else 280#else
253static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) 281static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
254{ 282{
@@ -256,9 +284,6 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char *
256} 284}
257#endif 285#endif
258 286
259#define pr_info(fmt,arg...) \
260 printk(KERN_INFO fmt,##arg)
261
262/* 287/*
263 * Display an IP address in readable format. 288 * Display an IP address in readable format.
264 */ 289 */