internal.h (a3f9e4bc1ec9d8f1e352eb7c1cbaea3168246be7) internal.h (6b93bb41f6eaa1cc5c5f30ec3b687b380f116cd0)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * internal.h - printk internal definitions
4 */
5#include <linux/percpu.h>
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * internal.h - printk internal definitions
4 */
5#include <linux/percpu.h>
6#include <linux/console.h>
6
7#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
8void __init printk_sysctl_init(void);
9int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
10 void *buffer, size_t *lenp, loff_t *ppos);
11#else
12#define printk_sysctl_init() do { } while (0)
13#endif

--- 42 unchanged lines hidden (view full) ---

56 __printk_safe_exit(); \
57 local_irq_restore(flags); \
58 } while (0)
59
60void defer_console_output(void);
61
62u16 printk_parse_prefix(const char *text, int *level,
63 enum printk_info_flags *flags);
7
8#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
9void __init printk_sysctl_init(void);
10int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
11 void *buffer, size_t *lenp, loff_t *ppos);
12#else
13#define printk_sysctl_init() do { } while (0)
14#endif

--- 42 unchanged lines hidden (view full) ---

57 __printk_safe_exit(); \
58 local_irq_restore(flags); \
59 } while (0)
60
61void defer_console_output(void);
62
63u16 printk_parse_prefix(const char *text, int *level,
64 enum printk_info_flags *flags);
65
66void nbcon_init(struct console *con);
67void nbcon_cleanup(struct console *con);
68
64#else
65
66#define PRINTK_PREFIX_MAX 0
67#define PRINTK_MESSAGE_MAX 0
68#define PRINTKRB_RECORD_MAX 0
69
70/*
71 * In !PRINTK builds we still export console_sem
72 * semaphore and some of console functions (console_unlock()/etc.), so
73 * printk-safe must preserve the existing local IRQ guarantees.
74 */
75#define printk_safe_enter_irqsave(flags) local_irq_save(flags)
76#define printk_safe_exit_irqrestore(flags) local_irq_restore(flags)
77
78static inline bool printk_percpu_data_ready(void) { return false; }
69#else
70
71#define PRINTK_PREFIX_MAX 0
72#define PRINTK_MESSAGE_MAX 0
73#define PRINTKRB_RECORD_MAX 0
74
75/*
76 * In !PRINTK builds we still export console_sem
77 * semaphore and some of console functions (console_unlock()/etc.), so
78 * printk-safe must preserve the existing local IRQ guarantees.
79 */
80#define printk_safe_enter_irqsave(flags) local_irq_save(flags)
81#define printk_safe_exit_irqrestore(flags) local_irq_restore(flags)
82
83static inline bool printk_percpu_data_ready(void) { return false; }
84static inline void nbcon_init(struct console *con) { }
85static inline void nbcon_cleanup(struct console *con) { }
86
79#endif /* CONFIG_PRINTK */
80
81/**
82 * struct printk_buffers - Buffers to read/format/output printk messages.
83 * @outbuf: After formatting, contains text to output.
84 * @scratchbuf: Used as temporary ringbuffer reading and string-print space.
85 */
86struct printk_buffers {

--- 21 unchanged lines hidden ---
87#endif /* CONFIG_PRINTK */
88
89/**
90 * struct printk_buffers - Buffers to read/format/output printk messages.
91 * @outbuf: After formatting, contains text to output.
92 * @scratchbuf: Used as temporary ringbuffer reading and string-print space.
93 */
94struct printk_buffers {

--- 21 unchanged lines hidden ---