diff options
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4d46e299afb5..2e70006c7fa8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -46,6 +46,9 @@ extern const char linux_proc_banner[]; | |||
| 46 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 46 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
| 47 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 47 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
| 48 | 48 | ||
| 49 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | ||
| 50 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | ||
| 51 | |||
| 49 | #ifdef CONFIG_LBD | 52 | #ifdef CONFIG_LBD |
| 50 | # include <asm/div64.h> | 53 | # include <asm/div64.h> |
| 51 | # define sector_div(a, b) do_div(a, b) | 54 | # define sector_div(a, b) do_div(a, b) |
| @@ -276,7 +279,17 @@ extern void print_hex_dump(const char *level, const char *prefix_str, | |||
| 276 | const void *buf, size_t len, bool ascii); | 279 | const void *buf, size_t len, bool ascii); |
| 277 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | 280 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
| 278 | const void *buf, size_t len); | 281 | const void *buf, size_t len); |
| 279 | #define hex_asc(x) "0123456789abcdef"[x] | 282 | |
| 283 | extern const char hex_asc[]; | ||
| 284 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | ||
| 285 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | ||
| 286 | |||
| 287 | static inline char *pack_hex_byte(char *buf, u8 byte) | ||
| 288 | { | ||
| 289 | *buf++ = hex_asc_hi(byte); | ||
| 290 | *buf++ = hex_asc_lo(byte); | ||
| 291 | return buf; | ||
| 292 | } | ||
| 280 | 293 | ||
| 281 | #define pr_emerg(fmt, arg...) \ | 294 | #define pr_emerg(fmt, arg...) \ |
| 282 | printk(KERN_EMERG fmt, ##arg) | 295 | printk(KERN_EMERG fmt, ##arg) |
