X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Flinux%2Fcompat.h;h=35e216e06e1b7b7ed15116eb46f248d3897c6b0e;hb=8f2df5d369ea57a2c1e4697e508a86fc1346e76f;hp=e1338bf489f8a1934c1c1e669d3db5db48d712be;hpb=0d4c1c91bb2852ff6f4e46f40e72e74ec10599c5;p=u-boot diff --git a/include/linux/compat.h b/include/linux/compat.h index e1338bf489..35e216e06e 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -3,6 +3,14 @@ #define ndelay(x) udelay(1) +#define dev_dbg(dev, fmt, args...) \ + debug(fmt, ##args) +#define dev_vdbg(dev, fmt, args...) \ + debug(fmt, ##args) +#define dev_info(dev, fmt, args...) \ + printf(fmt, ##args) +#define dev_err(dev, fmt, args...) \ + printf(fmt, ##args) #define printk printf #define KERN_EMERG @@ -49,4 +57,23 @@ , __FILE__, __LINE__); } #define PAGE_SIZE 4096 + +/** + * upper_32_bits - return MSB bits 32-63 of a number if little endian, or + * return MSB bits 0-31 of a number if big endian. + * @n: the number we're accessing + * + * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress + * the "right shift count >= width of type" warning when that quantity is + * 32-bits. + */ +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) + +/** + * lower_32_bits - return LSB bits 0-31 of a number if little endian, or + * return LSB bits 32-63 of a number if big endian. + * @n: the number we're accessing + */ +#define lower_32_bits(n) ((u32)(n)) + #endif