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.h44
1 files changed, 21 insertions, 23 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8317ec4b9f3b..2b0a35e6bc69 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -171,12 +171,18 @@ static inline void might_fault(void)
171} 171}
172#endif 172#endif
173 173
174struct va_format {
175 const char *fmt;
176 va_list *va;
177};
178
174extern struct atomic_notifier_head panic_notifier_list; 179extern struct atomic_notifier_head panic_notifier_list;
175extern long (*panic_blink)(long time); 180extern long (*panic_blink)(int state);
176NORET_TYPE void panic(const char * fmt, ...) 181NORET_TYPE void panic(const char * fmt, ...)
177 __attribute__ ((NORET_AND format (printf, 1, 2))) __cold; 182 __attribute__ ((NORET_AND format (printf, 1, 2))) __cold;
178extern void oops_enter(void); 183extern void oops_enter(void);
179extern void oops_exit(void); 184extern void oops_exit(void);
185void print_oops_end_marker(void);
180extern int oops_may_print(void); 186extern int oops_may_print(void);
181NORET_TYPE void do_exit(long error_code) 187NORET_TYPE void do_exit(long error_code)
182 ATTRIB_NORET; 188 ATTRIB_NORET;
@@ -247,6 +253,13 @@ extern struct pid *session_of_pgrp(struct pid *pgrp);
247#define FW_WARN "[Firmware Warn]: " 253#define FW_WARN "[Firmware Warn]: "
248#define FW_INFO "[Firmware Info]: " 254#define FW_INFO "[Firmware Info]: "
249 255
256/*
257 * HW_ERR
258 * Add this to a message for hardware errors, so that user can report
259 * it to hardware vendor instead of LKML or software vendor.
260 */
261#define HW_ERR "[Hardware Error]: "
262
250#ifdef CONFIG_PRINTK 263#ifdef CONFIG_PRINTK
251asmlinkage int vprintk(const char *fmt, va_list args) 264asmlinkage int vprintk(const char *fmt, va_list args)
252 __attribute__ ((format (printf, 1, 0))); 265 __attribute__ ((format (printf, 1, 0)));
@@ -293,6 +306,13 @@ static inline void log_buf_kexec_setup(void)
293} 306}
294#endif 307#endif
295 308
309/*
310 * Dummy printk for disabled debugging statements to use whilst maintaining
311 * gcc's format and side-effect checking.
312 */
313static inline __attribute__ ((format (printf, 1, 2)))
314int no_printk(const char *s, ...) { return 0; }
315
296extern int printk_needs_cpu(int cpu); 316extern int printk_needs_cpu(int cpu);
297extern void printk_tick(void); 317extern void printk_tick(void);
298 318
@@ -508,9 +528,6 @@ extern void tracing_start(void);
508extern void tracing_stop(void); 528extern void tracing_stop(void);
509extern void ftrace_off_permanent(void); 529extern void ftrace_off_permanent(void);
510 530
511extern void
512ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
513
514static inline void __attribute__ ((format (printf, 1, 2))) 531static inline void __attribute__ ((format (printf, 1, 2)))
515____trace_printk_check_format(const char *fmt, ...) 532____trace_printk_check_format(const char *fmt, ...)
516{ 533{
@@ -586,8 +603,6 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
586 603
587extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); 604extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
588#else 605#else
589static inline void
590ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
591static inline int 606static inline int
592trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 607trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
593 608
@@ -609,17 +624,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
609#endif /* CONFIG_TRACING */ 624#endif /* CONFIG_TRACING */
610 625
611/* 626/*
612 * Display an IP address in readable format.
613 */
614
615#define NIPQUAD(addr) \
616 ((unsigned char *)&addr)[0], \
617 ((unsigned char *)&addr)[1], \
618 ((unsigned char *)&addr)[2], \
619 ((unsigned char *)&addr)[3]
620#define NIPQUAD_FMT "%u.%u.%u.%u"
621
622/*
623 * min()/max()/clamp() macros that also do 627 * min()/max()/clamp() macros that also do
624 * strict type-checking.. See the 628 * strict type-checking.. See the
625 * "unnecessary" pointer comparison. 629 * "unnecessary" pointer comparison.
@@ -728,12 +732,6 @@ extern int do_sysinfo(struct sysinfo *info);
728 732
729#endif /* __KERNEL__ */ 733#endif /* __KERNEL__ */
730 734
731#ifndef __EXPORTED_HEADERS__
732#ifndef __KERNEL__
733#warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders
734#endif /* __KERNEL__ */
735#endif /* __EXPORTED_HEADERS__ */
736
737#define SI_LOAD_SHIFT 16 735#define SI_LOAD_SHIFT 16
738struct sysinfo { 736struct sysinfo {
739 long uptime; /* Seconds since boot */ 737 long uptime; /* Seconds since boot */