VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: John Ogness <john.ogness@linutronix.de> 2020-11-30 01:42:06 +0106 committer: Minda Chen <minda.chen@starfivetech.com> 2023-11-06 19:24:37 +0800 commit: 69dbe75e276a599b0899f90c2af6e547dd81fd7e parent: 13f94a9f0bb8b7d4f85d08e0a08adbf2fb9f1201
Commit Summary:
printk: introduce kernel sync mode
Diffstat:
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index b0e783248b20..4dd8b0ce417d 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -16,6 +16,7 @@
 
 #include <linux/atomic.h>
 #include <linux/types.h>
+#include <linux/printk.h>
 
 struct vc_data;
 struct console_font_op;
@@ -150,6 +151,9 @@ struct console {
 	short	flags;
 	short	index;
 	int	cflag;
+#ifdef CONFIG_PRINTK
+	char	sync_buf[CONSOLE_LOG_MAX];
+#endif
 	void	*data;
 	struct	 console *next;
 };
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 453458c722f5..fb82a5e15b9d 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -47,6 +47,12 @@ static inline const char *printk_skip_headers(const char *buffer)
 
 #define CONSOLE_EXT_LOG_MAX	8192
 
+/*
+ * The maximum size of a record formatted for console printing
+ * (i.e. with the prefix prepended to every line).
+ */
+#define CONSOLE_LOG_MAX		1024
+
 /* printk's without a loglevel use this.. */
 #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT