hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/printk.h
....@@ -45,12 +45,6 @@
4545
4646 #define CONSOLE_EXT_LOG_MAX 8192
4747
48
-/*
49
- * The maximum size of a record formatted for console printing
50
- * (i.e. with the prefix prepended to every line).
51
- */
52
-#define CONSOLE_LOG_MAX 4096
53
-
5448 /* printk's without a loglevel use this.. */
5549 #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT
5650
....@@ -154,6 +148,18 @@
154148 void early_printk(const char *s, ...) { }
155149 #endif
156150
151
+#ifdef CONFIG_PRINTK_NMI
152
+extern void printk_nmi_enter(void);
153
+extern void printk_nmi_exit(void);
154
+extern void printk_nmi_direct_enter(void);
155
+extern void printk_nmi_direct_exit(void);
156
+#else
157
+static inline void printk_nmi_enter(void) { }
158
+static inline void printk_nmi_exit(void) { }
159
+static inline void printk_nmi_direct_enter(void) { }
160
+static inline void printk_nmi_direct_exit(void) { }
161
+#endif /* PRINTK_NMI */
162
+
157163 struct dev_printk_info;
158164
159165 #ifdef CONFIG_PRINTK
....@@ -201,6 +207,8 @@
201207 void show_regs_print_info(const char *log_lvl);
202208 extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold;
203209 extern asmlinkage void dump_stack(void) __cold;
210
+extern void printk_safe_flush(void);
211
+extern void printk_safe_flush_on_panic(void);
204212 #else
205213 static inline __printf(1, 0)
206214 int vprintk(const char *s, va_list args)
....@@ -266,6 +274,14 @@
266274 }
267275
268276 static inline void dump_stack(void)
277
+{
278
+}
279
+
280
+static inline void printk_safe_flush(void)
281
+{
282
+}
283
+
284
+static inline void printk_safe_flush_on_panic(void)
269285 {
270286 }
271287 #endif
....@@ -485,8 +501,6 @@
485501 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
486502 #endif
487503
488
-bool pr_flush(int timeout_ms, bool reset_on_progress);
489
-
490504 /*
491505 * ratelimited messages with local ratelimit_state,
492506 * no local ratelimit_state used in the !PRINTK case
....@@ -613,4 +627,23 @@
613627 #define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
614628 print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true)
615629
630
+#ifdef CONFIG_PRINTK
631
+extern void __printk_safe_enter(void);
632
+extern void __printk_safe_exit(void);
633
+/*
634
+ * The printk_deferred_enter/exit macros are available only as a hack for
635
+ * some code paths that need to defer all printk console printing. Interrupts
636
+ * must be disabled for the deferred duration.
637
+ */
638
+#define printk_deferred_enter __printk_safe_enter
639
+#define printk_deferred_exit __printk_safe_exit
640
+#else
641
+static inline void printk_deferred_enter(void)
642
+{
643
+}
644
+static inline void printk_deferred_exit(void)
645
+{
646
+}
647
+#endif
648
+
616649 #endif