diff options
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fc33af911852..8317ec4b9f3b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -24,9 +24,9 @@ | |||
| 24 | extern const char linux_banner[]; | 24 | extern const char linux_banner[]; |
| 25 | extern const char linux_proc_banner[]; | 25 | extern const char linux_proc_banner[]; |
| 26 | 26 | ||
| 27 | #define USHORT_MAX ((u16)(~0U)) | 27 | #define USHRT_MAX ((u16)(~0U)) |
| 28 | #define SHORT_MAX ((s16)(USHORT_MAX>>1)) | 28 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) |
| 29 | #define SHORT_MIN (-SHORT_MAX - 1) | 29 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) |
| 30 | #define INT_MAX ((int)(~0U>>1)) | 30 | #define INT_MAX ((int)(~0U>>1)) |
| 31 | #define INT_MIN (-INT_MAX - 1) | 31 | #define INT_MIN (-INT_MAX - 1) |
| 32 | #define UINT_MAX (~0U) | 32 | #define UINT_MAX (~0U) |
| @@ -346,6 +346,7 @@ extern enum system_states { | |||
| 346 | #define TAINT_OVERRIDDEN_ACPI_TABLE 8 | 346 | #define TAINT_OVERRIDDEN_ACPI_TABLE 8 |
| 347 | #define TAINT_WARN 9 | 347 | #define TAINT_WARN 9 |
| 348 | #define TAINT_CRAP 10 | 348 | #define TAINT_CRAP 10 |
| 349 | #define TAINT_FIRMWARE_WORKAROUND 11 | ||
| 349 | 350 | ||
| 350 | extern void dump_stack(void) __cold; | 351 | extern void dump_stack(void) __cold; |
| 351 | 352 | ||
| @@ -374,6 +375,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 374 | return buf; | 375 | return buf; |
| 375 | } | 376 | } |
| 376 | 377 | ||
| 378 | extern int hex_to_bin(char ch); | ||
| 379 | |||
| 377 | #ifndef pr_fmt | 380 | #ifndef pr_fmt |
| 378 | #define pr_fmt(fmt) fmt | 381 | #define pr_fmt(fmt) fmt |
| 379 | #endif | 382 | #endif |
| @@ -388,6 +391,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 388 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 391 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
| 389 | #define pr_warning(fmt, ...) \ | 392 | #define pr_warning(fmt, ...) \ |
| 390 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 393 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
| 394 | #define pr_warn pr_warning | ||
| 391 | #define pr_notice(fmt, ...) \ | 395 | #define pr_notice(fmt, ...) \ |
| 392 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 396 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
| 393 | #define pr_info(fmt, ...) \ | 397 | #define pr_info(fmt, ...) \ |
| @@ -422,14 +426,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 422 | * no local ratelimit_state used in the !PRINTK case | 426 | * no local ratelimit_state used in the !PRINTK case |
| 423 | */ | 427 | */ |
| 424 | #ifdef CONFIG_PRINTK | 428 | #ifdef CONFIG_PRINTK |
| 425 | #define printk_ratelimited(fmt, ...) ({ \ | 429 | #define printk_ratelimited(fmt, ...) ({ \ |
| 426 | static struct ratelimit_state _rs = { \ | 430 | static DEFINE_RATELIMIT_STATE(_rs, \ |
| 427 | .interval = DEFAULT_RATELIMIT_INTERVAL, \ | 431 | DEFAULT_RATELIMIT_INTERVAL, \ |
| 428 | .burst = DEFAULT_RATELIMIT_BURST, \ | 432 | DEFAULT_RATELIMIT_BURST); \ |
| 429 | }; \ | 433 | \ |
| 430 | \ | 434 | if (__ratelimit(&_rs)) \ |
| 431 | if (__ratelimit(&_rs)) \ | 435 | printk(fmt, ##__VA_ARGS__); \ |
| 432 | printk(fmt, ##__VA_ARGS__); \ | ||
| 433 | }) | 436 | }) |
| 434 | #else | 437 | #else |
| 435 | /* No effect, but we still get type checking even in the !PRINTK case: */ | 438 | /* No effect, but we still get type checking even in the !PRINTK case: */ |
| @@ -446,6 +449,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 446 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 449 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
| 447 | #define pr_warning_ratelimited(fmt, ...) \ | 450 | #define pr_warning_ratelimited(fmt, ...) \ |
| 448 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 451 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
| 452 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
| 449 | #define pr_notice_ratelimited(fmt, ...) \ | 453 | #define pr_notice_ratelimited(fmt, ...) \ |
| 450 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 454 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
| 451 | #define pr_info_ratelimited(fmt, ...) \ | 455 | #define pr_info_ratelimited(fmt, ...) \ |
