From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! include: rename printk.h to printf.h
Date: Mon, 6 Jan 2025 11:37:41 +0100 [thread overview]
Message-ID: <20250106103741.1022357-1-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <to=<20250106091906.3435166-1-a.fatoum@pengutronix.de>
Missing file...
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
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
next parent reply other threads:[~2025-01-06 10:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <to=<20250106091906.3435166-1-a.fatoum@pengutronix.de>
2025-01-06 10:37 ` Ahmad Fatoum [this message]
2025-01-06 13:21 ` (subset) " Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250106103741.1022357-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox