X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fkernel.h;h=a7283c9beadff498968eb1ff506b5369077ae96c;hb=ad1b30b1c282bc8c726a9b123a1312a3930bcd42;hp=d9725a28a2655d14919906359198e0685e98e56c;hpb=71a380d668189778416d37cde5521575a45c5a17;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d9725a28a26..a7283c9bead 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -35,6 +35,7 @@ extern const char linux_proc_banner[]; #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) +#define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) @@ -75,6 +76,13 @@ extern const char linux_proc_banner[]; #define KERN_INFO "<6>" /* informational */ #define KERN_DEBUG "<7>" /* debug-level messages */ +/* + * Annotation for a "continued" line of log printout (only done after a + * line that had no enclosing \n). Only to be used by core/arch code + * during early bootup (a continued line is not SMP-safe otherwise). + */ +#define KERN_CONT "" + extern int console_printk[]; #define console_loglevel (console_printk[0]) @@ -97,8 +105,8 @@ struct user; * supposed to. */ #ifdef CONFIG_PREEMPT_VOLUNTARY -extern int cond_resched(void); -# define might_resched() cond_resched() +extern int _cond_resched(void); +# define might_resched() _cond_resched() #else # define might_resched() do { } while (0) #endif @@ -171,6 +179,9 @@ asmlinkage int vprintk(const char *fmt, va_list args) __attribute__ ((format (printf, 1, 0))); asmlinkage int printk(const char * fmt, ...) __attribute__ ((format (printf, 1, 2))) __cold; +extern int log_buf_get_len(void); +extern int log_buf_read(int idx); +extern int log_buf_copy(char *dest, int idx, int len); #else static inline int vprintk(const char *s, va_list args) __attribute__ ((format (printf, 1, 0))); @@ -178,6 +189,9 @@ static inline int vprintk(const char *s, va_list args) { return 0; } static inline int printk(const char *s, ...) __attribute__ ((format (printf, 1, 2))); static inline int __cold printk(const char *s, ...) { return 0; } +static inline int log_buf_get_len(void) { return 0; } +static inline int log_buf_read(int idx) { return 0; } +static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } #endif unsigned long int_sqrt(unsigned long); @@ -244,10 +258,25 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, const void *buf, size_t len); #define hex_asc(x) "0123456789abcdef"[x] +#define pr_emerg(fmt, arg...) \ + printk(KERN_EMERG fmt, ##arg) +#define pr_alert(fmt, arg...) \ + printk(KERN_ALERT fmt, ##arg) +#define pr_crit(fmt, arg...) \ + printk(KERN_CRIT fmt, ##arg) +#define pr_err(fmt, arg...) \ + printk(KERN_ERR fmt, ##arg) +#define pr_warning(fmt, arg...) \ + printk(KERN_WARNING fmt, ##arg) +#define pr_notice(fmt, arg...) \ + printk(KERN_NOTICE fmt, ##arg) +#define pr_info(fmt, arg...) \ + printk(KERN_INFO fmt, ##arg) + #ifdef DEBUG /* If you are writing a driver, please use dev_dbg instead */ -#define pr_debug(fmt,arg...) \ - printk(KERN_DEBUG fmt,##arg) +#define pr_debug(fmt, arg...) \ + printk(KERN_DEBUG fmt, ##arg) #else static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) { @@ -255,9 +284,6 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * } #endif -#define pr_info(fmt,arg...) \ - printk(KERN_INFO fmt,##arg) - /* * Display an IP address in readable format. */