diff options
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b9b5e4ba16..63fb18dcac 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -13,10 +13,12 @@ | |||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
| 15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
| 16 | #include <linux/log2.h> | ||
| 16 | #include <asm/byteorder.h> | 17 | #include <asm/byteorder.h> |
| 17 | #include <asm/bug.h> | 18 | #include <asm/bug.h> |
| 18 | 19 | ||
| 19 | extern const char linux_banner[]; | 20 | extern const char linux_banner[]; |
| 21 | extern const char linux_proc_banner[]; | ||
| 20 | 22 | ||
| 21 | #define INT_MAX ((int)(~0U>>1)) | 23 | #define INT_MAX ((int)(~0U>>1)) |
| 22 | #define INT_MIN (-INT_MAX - 1) | 24 | #define INT_MIN (-INT_MAX - 1) |
| @@ -65,7 +67,7 @@ struct user; | |||
| 65 | * context (spinlock, irq-handler, ...). | 67 | * context (spinlock, irq-handler, ...). |
| 66 | * | 68 | * |
| 67 | * This is a useful debugging help to be able to catch problems early and not | 69 | * This is a useful debugging help to be able to catch problems early and not |
| 68 | * be biten later when the calling function happens to sleep when it is not | 70 | * be bitten later when the calling function happens to sleep when it is not |
| 69 | * supposed to. | 71 | * supposed to. |
| 70 | */ | 72 | */ |
| 71 | #ifdef CONFIG_PREEMPT_VOLUNTARY | 73 | #ifdef CONFIG_PREEMPT_VOLUNTARY |
| @@ -157,20 +159,6 @@ static inline int printk(const char *s, ...) { return 0; } | |||
| 157 | 159 | ||
| 158 | unsigned long int_sqrt(unsigned long); | 160 | unsigned long int_sqrt(unsigned long); |
| 159 | 161 | ||
| 160 | static inline int __attribute_pure__ long_log2(unsigned long x) | ||
| 161 | { | ||
| 162 | int r = 0; | ||
| 163 | for (x >>= 1; x > 0; x >>= 1) | ||
| 164 | r++; | ||
| 165 | return r; | ||
| 166 | } | ||
| 167 | |||
| 168 | static inline unsigned long | ||
| 169 | __attribute_const__ roundup_pow_of_two(unsigned long x) | ||
| 170 | { | ||
| 171 | return 1UL << fls_long(x - 1); | ||
| 172 | } | ||
| 173 | |||
| 174 | extern int printk_ratelimit(void); | 162 | extern int printk_ratelimit(void); |
| 175 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | 163 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); |
| 176 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 164 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
