X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fkernel.h;h=a7283c9beadff498968eb1ff506b5369077ae96c;hb=ad1b30b1c282bc8c726a9b123a1312a3930bcd42;hp=f592df74b3cfb48637e3806e1e048a384582e53c;hpb=53fdc5185c994ad6def3729a905ac4a47c477c9d;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f592df74b3c..a7283c9bead 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -34,6 +34,8 @@ 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)) @@ -41,6 +43,20 @@ extern const char linux_proc_banner[]; #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) +#ifdef CONFIG_LBD +# include +# define sector_div(a, b) do_div(a, b) +#else +# define sector_div(n, b)( \ +{ \ + int _res; \ + _res = (n) % (b); \ + (n) /= (b); \ + _res; \ +} \ +) +#endif + /** * upper_32_bits - return bits 32-63 of a number * @n: the number we're accessing @@ -60,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]) @@ -82,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 @@ -156,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))); @@ -163,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); @@ -229,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, ...) { @@ -240,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. */