summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h10
-rw-r--r--include/printk.h21
2 files changed, 20 insertions, 11 deletions
diff --git a/include/common.h b/include/common.h
index f52c7e430c..11d26cb3db 100644
--- a/include/common.h
+++ b/include/common.h
@@ -112,16 +112,6 @@ void shutdown_barebox(void);
#define PAGE_ALIGN(s) ALIGN(s, PAGE_SIZE)
#define PAGE_ALIGN_DOWN(x) ALIGN_DOWN(x, PAGE_SIZE)
-int memory_display(const void *addr, loff_t offs, unsigned nbytes, int size, int swab);
-
-#define DUMP_PREFIX_OFFSET 0
-static inline void print_hex_dump(const char *level, const char *prefix_str,
- int prefix_type, int rowsize, int groupsize,
- const void *buf, size_t len, bool ascii)
-{
- memory_display(buf, 0, len, 4, 0);
-}
-
int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
char **sourcefile, char **destfile, int *swab);
#define RW_BUF_SIZE (unsigned)4096
diff --git a/include/printk.h b/include/printk.h
index 4384fb85ea..aaad07552e 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -91,7 +91,7 @@ static inline int pr_print(int level, const char *format, ...)
#define pr_debug(fmt, arg...) __pr_printk(7, pr_fmt(fmt), ##arg)
#define debug(fmt, arg...) __pr_printk(7, pr_fmt(fmt), ##arg)
#define pr_vdebug(fmt, arg...) __pr_printk(8, pr_fmt(fmt), ##arg)
-#define pr_cont(fmt, arg...) __pr_printk(0, fmt, ##arg)
+#define pr_cont(fmt, arg...) __pr_printk(-1, fmt, ##arg)
#define printk_once(fmt, ...) \
({ \
@@ -103,6 +103,25 @@ static inline int pr_print(int level, const char *format, ...)
} \
})
+int memory_display(const void *addr, loff_t offs, unsigned nbytes, int size,
+ int swab);
+int __pr_memory_display(int level, const void *addr, loff_t offs, unsigned nbytes,
+ int size, int swab, const char *format, ...);
+
+#define pr_memory_display(level, addr, offs, nbytes, size, swab) \
+ ({ \
+ (level) <= LOGLEVEL ? __pr_memory_display((level), (addr), \
+ (offs), (nbytes), (size), (swab), pr_fmt("")) : 0; \
+ })
+
+#define DUMP_PREFIX_OFFSET 0
+static inline void print_hex_dump(const char *level, const char *prefix_str,
+ int prefix_type, int rowsize, int groupsize,
+ const void *buf, size_t len, bool ascii)
+{
+ memory_display(buf, 0, len, 4, 0);
+}
+
struct log_entry {
struct list_head list;
char *msg;