diff options
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 9365227dbaf6..fc33af911852 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | /* | 4 | /* |
| 5 | * 'kernel.h' contains some often-used function prototypes etc | 5 | * 'kernel.h' contains some often-used function prototypes etc |
| 6 | */ | 6 | */ |
| 7 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) | ||
| 8 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) | ||
| 7 | 9 | ||
| 8 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 9 | 11 | ||
| @@ -37,8 +39,8 @@ extern const char linux_proc_banner[]; | |||
| 37 | 39 | ||
| 38 | #define STACK_MAGIC 0xdeadbeef | 40 | #define STACK_MAGIC 0xdeadbeef |
| 39 | 41 | ||
| 40 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 42 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) |
| 41 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 43 | #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) |
| 42 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) | 44 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) |
| 43 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) | 45 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) |
| 44 | 46 | ||
| @@ -490,6 +492,13 @@ static inline void tracing_off(void) { } | |||
| 490 | static inline void tracing_off_permanent(void) { } | 492 | static inline void tracing_off_permanent(void) { } |
| 491 | static inline int tracing_is_on(void) { return 0; } | 493 | static inline int tracing_is_on(void) { return 0; } |
| 492 | #endif | 494 | #endif |
| 495 | |||
| 496 | enum ftrace_dump_mode { | ||
| 497 | DUMP_NONE, | ||
| 498 | DUMP_ALL, | ||
| 499 | DUMP_ORIG, | ||
| 500 | }; | ||
| 501 | |||
| 493 | #ifdef CONFIG_TRACING | 502 | #ifdef CONFIG_TRACING |
| 494 | extern void tracing_start(void); | 503 | extern void tracing_start(void); |
| 495 | extern void tracing_stop(void); | 504 | extern void tracing_stop(void); |
| @@ -571,7 +580,7 @@ __ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap); | |||
| 571 | extern int | 580 | extern int |
| 572 | __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | 581 | __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); |
| 573 | 582 | ||
| 574 | extern void ftrace_dump(void); | 583 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); |
| 575 | #else | 584 | #else |
| 576 | static inline void | 585 | static inline void |
| 577 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | 586 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } |
| @@ -592,7 +601,7 @@ ftrace_vprintk(const char *fmt, va_list ap) | |||
| 592 | { | 601 | { |
| 593 | return 0; | 602 | return 0; |
| 594 | } | 603 | } |
| 595 | static inline void ftrace_dump(void) { } | 604 | static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } |
| 596 | #endif /* CONFIG_TRACING */ | 605 | #endif /* CONFIG_TRACING */ |
| 597 | 606 | ||
| 598 | /* | 607 | /* |
