Missing file... Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- include/printf.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 include/printf.h diff --git a/include/printf.h b/include/printf.h new file mode 100644 index 000000000000..9a84850d02bf --- /dev/null +++ b/include/printf.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __PRINTF_H +#define __PRINTF_H + +#include <linux/types.h> + +struct device; + +#define KERN_EMERG "" /* system is unusable */ +#define KERN_ALERT "" /* action must be taken immediately */ +#define KERN_CRIT "" /* critical conditions */ +#define KERN_ERR "" /* error conditions */ +#define KERN_WARNING "" /* warning conditions */ +#define KERN_NOTICE "" /* normal but significant condition */ +#define KERN_INFO "" /* informational */ +#define KERN_DEBUG "" /* debug-level messages */ +#define KERN_CONT "" + +#if (IN_PROPER && !defined(CONFIG_CONSOLE_NONE)) || \ + (IN_PBL && defined(CONFIG_PBL_CONSOLE)) +int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2))); +#else +static int printf(const char *fmt, ...) __attribute__ ((format(__printf__, 1, 2))); +static inline int printf(const char *fmt, ...) +{ + return 0; +} +#endif + +void __attribute__((noreturn)) panic(const char *fmt, ...); +void __attribute__((noreturn)) panic_no_stacktrace(const char *fmt, ...); + +#define printk printf + +enum { + DUMP_PREFIX_NONE, + DUMP_PREFIX_ADDRESS, + DUMP_PREFIX_OFFSET +}; +extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, + int groupsize, char *linebuf, size_t linebuflen, + bool ascii); +extern void dev_print_hex_dump(struct device *dev, const char *level, + const char *prefix_str, int prefix_type, + int rowsize, int groupsize, const void *buf, + size_t len, bool ascii); + +#define print_hex_dump(level, prefix_str, prefix_type, rowsize, \ + groupsize, buf, len, ascii) \ + dev_print_hex_dump(NULL, level, prefix_str, prefix_type, rowsize, \ + groupsize, buf, len, ascii) + +#ifdef CONFIG_ARCH_HAS_STACK_DUMP +void dump_stack(void); +#else +static inline void dump_stack(void) +{ + printf("no stack data available\n"); +} +#endif + + +#endif -- 2.39.5