1 // SPDX-License-Identifier: GPL-2.0+
4 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
9 #include <debug_uart.h>
18 #include <stdio_dev.h>
20 #include <env_internal.h>
22 #include <linux/delay.h>
24 DECLARE_GLOBAL_DATA_PTR;
26 static int on_console(const char *name, const char *value, enum env_op op,
31 /* Check for console redirection */
32 if (strcmp(name, "stdin") == 0)
34 else if (strcmp(name, "stdout") == 0)
36 else if (strcmp(name, "stderr") == 0)
39 /* if not actually setting a console variable, we don't care */
40 if (console == -1 || (gd->flags & GD_FLG_DEVINIT) == 0)
45 case env_op_overwrite:
47 if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
48 if (iomux_doenv(console, value))
51 /* Try assigning specified device */
52 if (console_assign(console, value) < 0)
59 if ((flags & H_FORCE) == 0)
60 printf("Can't delete \"%s\"\n", name);
67 U_BOOT_ENV_CALLBACK(console, on_console);
69 #ifdef CONFIG_SILENT_CONSOLE
70 static int on_silent(const char *name, const char *value, enum env_op op,
73 if (!CONFIG_IS_ENABLED(SILENT_CONSOLE_UPDATE_ON_SET))
74 if (flags & H_INTERACTIVE)
77 if (!CONFIG_IS_ENABLED(SILENT_CONSOLE_UPDATE_ON_RELOC))
78 if ((flags & H_INTERACTIVE) == 0)
82 gd->flags |= GD_FLG_SILENT;
84 gd->flags &= ~GD_FLG_SILENT;
88 U_BOOT_ENV_CALLBACK(silent, on_silent);
91 #ifdef CONFIG_CONSOLE_RECORD
92 /* helper function: access to gd->console_out and gd->console_in */
93 static void console_record_putc(const char c)
95 if (!(gd->flags & GD_FLG_RECORD))
97 if (gd->console_out.start)
98 membuff_putbyte((struct membuff *)&gd->console_out, c);
101 static void console_record_puts(const char *s)
103 if (!(gd->flags & GD_FLG_RECORD))
105 if (gd->console_out.start)
106 membuff_put((struct membuff *)&gd->console_out, s, strlen(s));
109 static int console_record_getc(void)
111 if (!(gd->flags & GD_FLG_RECORD))
113 if (!gd->console_in.start)
116 return membuff_getbyte((struct membuff *)&gd->console_in);
119 static int console_record_tstc(void)
121 if (!(gd->flags & GD_FLG_RECORD))
123 if (gd->console_in.start) {
124 if (membuff_peekbyte((struct membuff *)&gd->console_in) != -1)
130 static void console_record_putc(char c)
134 static void console_record_puts(const char *s)
138 static int console_record_getc(void)
143 static int console_record_tstc(void)
149 #if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
151 * if overwrite_console returns 1, the stdin, stderr and stdout
152 * are switched to the serial port, else the settings in the
153 * environment are used
155 #ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
156 extern int overwrite_console(void);
157 #define OVERWRITE_CONSOLE overwrite_console()
159 #define OVERWRITE_CONSOLE 0
160 #endif /* CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE */
162 #endif /* CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */
164 static int console_setfile(int file, struct stdio_dev * dev)
175 error = console_start(file, dev);
179 /* Assign the new device (leaving the existing one started) */
180 stdio_devices[file] = dev;
183 * Update monitor functions
184 * (to use the console stuff by other applications)
188 gd->jt->getc = getchar;
194 gd->jt->printf = printf;
199 default: /* Invalid file ID */
206 * console_dev_is_serial() - Check if a stdio device is a serial device
208 * @sdev: Device to check
209 * @return true if this device is in the serial uclass (or for pre-driver-model,
210 * whether it is called "serial".
212 static bool console_dev_is_serial(struct stdio_dev *sdev)
216 if (IS_ENABLED(CONFIG_DM_SERIAL) && (sdev->flags & DEV_FLAGS_DM)) {
217 struct udevice *dev = sdev->priv;
219 is_serial = device_get_uclass_id(dev) == UCLASS_SERIAL;
221 is_serial = !strcmp(sdev->name, "serial");
227 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
228 /** Console I/O multiplexing *******************************************/
230 /* tstcdev: save the last stdio device with pending characters, with tstc != 0 */
231 static struct stdio_dev *tstcdev;
232 struct stdio_dev **console_devices[MAX_FILES];
233 int cd_count[MAX_FILES];
235 static void __maybe_unused console_devices_set(int file, struct stdio_dev *dev)
237 console_devices[file][0] = dev;
241 * This depends on tstc() always being called before getchar().
242 * This is guaranteed to be true because this routine is called
243 * only from fgetc() which assures it.
244 * No attempt is made to demultiplex multiple input sources.
246 static int console_getc(int file)
250 /* This is never called with testcdev == NULL */
251 ret = tstcdev->getc(tstcdev);
256 /* Upper layer may have already called tstc(): check the saved result */
257 static bool console_has_tstc(void)
262 static int console_tstc(int file)
265 struct stdio_dev *dev;
268 prev = disable_ctrlc(1);
269 for (i = 0; i < cd_count[file]; i++) {
270 dev = console_devices[file][i];
271 if (dev->tstc != NULL) {
272 ret = dev->tstc(dev);
285 static void console_putc(int file, const char c)
288 struct stdio_dev *dev;
290 for (i = 0; i < cd_count[file]; i++) {
291 dev = console_devices[file][i];
292 if (dev->putc != NULL)
298 * console_puts_select() - Output a string to all console devices
300 * @file: File number to output to (e,g, stdout, see stdio.h)
301 * @serial_only: true to output only to serial, false to output to everything
303 * @s: String to output
305 static void console_puts_select(int file, bool serial_only, const char *s)
308 struct stdio_dev *dev;
310 for (i = 0; i < cd_count[file]; i++) {
313 dev = console_devices[file][i];
314 is_serial = console_dev_is_serial(dev);
315 if (dev->puts && serial_only == is_serial)
320 void console_puts_select_stderr(bool serial_only, const char *s)
322 console_puts_select(stderr, serial_only, s);
325 static void console_puts(int file, const char *s)
328 struct stdio_dev *dev;
330 for (i = 0; i < cd_count[file]; i++) {
331 dev = console_devices[file][i];
332 if (dev->puts != NULL)
337 #if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
338 static inline void console_doenv(int file, struct stdio_dev *dev)
340 iomux_doenv(file, dev->name);
345 static void __maybe_unused console_devices_set(int file, struct stdio_dev *dev)
349 static inline int console_getc(int file)
351 return stdio_devices[file]->getc(stdio_devices[file]);
354 static bool console_has_tstc(void)
359 static inline int console_tstc(int file)
361 return stdio_devices[file]->tstc(stdio_devices[file]);
364 static inline void console_putc(int file, const char c)
366 stdio_devices[file]->putc(stdio_devices[file], c);
369 void console_puts_select(int file, bool serial_only, const char *s)
371 if (serial_only == console_dev_is_serial(stdio_devices[file]))
372 stdio_devices[file]->puts(stdio_devices[file], s);
375 static inline void console_puts(int file, const char *s)
377 stdio_devices[file]->puts(stdio_devices[file], s);
380 #if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
381 static inline void console_doenv(int file, struct stdio_dev *dev)
383 console_setfile(file, dev);
386 #endif /* CONIFIG_IS_ENABLED(CONSOLE_MUX) */
388 int console_start(int file, struct stdio_dev *sdev)
392 /* Start new device */
394 error = sdev->start(sdev);
395 /* If it's not started don't use it */
402 void console_stop(int file, struct stdio_dev *sdev)
408 /** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
410 int serial_printf(const char *fmt, ...)
414 char printbuffer[CONFIG_SYS_PBSIZE];
418 /* For this to work, printbuffer must be larger than
419 * anything we ever want to print.
421 i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args);
424 serial_puts(printbuffer);
430 if (file < MAX_FILES) {
432 * Effectively poll for input wherever it may be available.
436 if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
438 * Upper layer may have already called tstc() so
439 * check for that first.
441 if (console_has_tstc())
442 return console_getc(file);
445 if (console_tstc(file))
446 return console_getc(file);
450 * If the watchdog must be rate-limited then it should
451 * already be handled in board-specific code.
453 if (IS_ENABLED(CONFIG_WATCHDOG))
463 if (file < MAX_FILES)
464 return console_tstc(file);
469 void fputc(int file, const char c)
471 if (file < MAX_FILES)
472 console_putc(file, c);
475 void fputs(int file, const char *s)
477 if (file < MAX_FILES)
478 console_puts(file, s);
481 int fprintf(int file, const char *fmt, ...)
485 char printbuffer[CONFIG_SYS_PBSIZE];
489 /* For this to work, printbuffer must be larger than
490 * anything we ever want to print.
492 i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args);
495 /* Send to desired file */
496 fputs(file, printbuffer);
500 /** U-Boot INITIAL CONSOLE-COMPATIBLE FUNCTION *****************************/
506 if (IS_ENABLED(CONFIG_DISABLE_CONSOLE) && (gd->flags & GD_FLG_DISABLE_CONSOLE))
509 if (!gd->have_console)
512 ch = console_record_getc();
516 if (gd->flags & GD_FLG_DEVINIT) {
517 /* Get from the standard input */
521 /* Send directly to the handler */
522 return serial_getc();
527 if (IS_ENABLED(CONFIG_DISABLE_CONSOLE) && (gd->flags & GD_FLG_DISABLE_CONSOLE))
530 if (!gd->have_console)
533 if (console_record_tstc())
536 if (gd->flags & GD_FLG_DEVINIT) {
537 /* Test the standard input */
541 /* Send directly to the handler */
542 return serial_tstc();
545 #define PRE_CONSOLE_FLUSHPOINT1_SERIAL 0
546 #define PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL 1
548 #if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
549 #define CIRC_BUF_IDX(idx) ((idx) % (unsigned long)CONFIG_PRE_CON_BUF_SZ)
551 static void pre_console_putc(const char c)
555 buffer = map_sysmem(CONFIG_PRE_CON_BUF_ADDR, CONFIG_PRE_CON_BUF_SZ);
557 buffer[CIRC_BUF_IDX(gd->precon_buf_idx++)] = c;
559 unmap_sysmem(buffer);
562 static void pre_console_puts(const char *s)
565 pre_console_putc(*s++);
568 static void print_pre_console_buffer(int flushpoint)
570 unsigned long in = 0, out = 0;
571 char buf_out[CONFIG_PRE_CON_BUF_SZ + 1];
574 if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
577 buf_in = map_sysmem(CONFIG_PRE_CON_BUF_ADDR, CONFIG_PRE_CON_BUF_SZ);
578 if (gd->precon_buf_idx > CONFIG_PRE_CON_BUF_SZ)
579 in = gd->precon_buf_idx - CONFIG_PRE_CON_BUF_SZ;
581 while (in < gd->precon_buf_idx)
582 buf_out[out++] = buf_in[CIRC_BUF_IDX(in++)];
583 unmap_sysmem(buf_in);
587 switch (flushpoint) {
588 case PRE_CONSOLE_FLUSHPOINT1_SERIAL:
591 case PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL:
592 console_puts_select(stdout, false, buf_out);
597 static inline void pre_console_putc(const char c) {}
598 static inline void pre_console_puts(const char *s) {}
599 static inline void print_pre_console_buffer(int flushpoint) {}
602 void putc(const char c)
607 console_record_putc(c);
609 /* sandbox can send characters to stdout before it has a console */
610 if (IS_ENABLED(CONFIG_SANDBOX) && !(gd->flags & GD_FLG_SERIAL_READY)) {
615 /* if we don't have a console yet, use the debug UART */
616 if (IS_ENABLED(CONFIG_DEBUG_UART) && !(gd->flags & GD_FLG_SERIAL_READY)) {
621 if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
622 if (!(gd->flags & GD_FLG_DEVINIT))
627 if (IS_ENABLED(CONFIG_DISABLE_CONSOLE) && (gd->flags & GD_FLG_DISABLE_CONSOLE))
630 if (!gd->have_console)
631 return pre_console_putc(c);
633 if (gd->flags & GD_FLG_DEVINIT) {
634 /* Send to the standard output */
637 /* Send directly to the handler */
643 void puts(const char *s)
648 console_record_puts(s);
650 /* sandbox can send characters to stdout before it has a console */
651 if (IS_ENABLED(CONFIG_SANDBOX) && !(gd->flags & GD_FLG_SERIAL_READY)) {
656 if (IS_ENABLED(CONFIG_DEBUG_UART) && !(gd->flags & GD_FLG_SERIAL_READY)) {
665 if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
666 if (!(gd->flags & GD_FLG_DEVINIT))
671 if (IS_ENABLED(CONFIG_DISABLE_CONSOLE) && (gd->flags & GD_FLG_DISABLE_CONSOLE))
674 if (!gd->have_console)
675 return pre_console_puts(s);
677 if (gd->flags & GD_FLG_DEVINIT) {
678 /* Send to the standard output */
681 /* Send directly to the handler */
687 #ifdef CONFIG_CONSOLE_RECORD
688 int console_record_init(void)
692 ret = membuff_new((struct membuff *)&gd->console_out,
693 CONFIG_CONSOLE_RECORD_OUT_SIZE);
696 ret = membuff_new((struct membuff *)&gd->console_in,
697 CONFIG_CONSOLE_RECORD_IN_SIZE);
702 void console_record_reset(void)
704 membuff_purge((struct membuff *)&gd->console_out);
705 membuff_purge((struct membuff *)&gd->console_in);
708 int console_record_reset_enable(void)
710 console_record_reset();
711 gd->flags |= GD_FLG_RECORD;
716 int console_record_readline(char *str, int maxlen)
718 return membuff_readline((struct membuff *)&gd->console_out, str,
722 int console_record_avail(void)
724 return membuff_avail((struct membuff *)&gd->console_out);
729 /* test if ctrl-c was pressed */
730 static int ctrlc_disabled = 0; /* see disable_ctrl() */
731 static int ctrlc_was_pressed = 0;
734 if (!ctrlc_disabled && gd->have_console) {
737 case 0x03: /* ^C - Control C */
738 ctrlc_was_pressed = 1;
748 /* Reads user's confirmation.
749 Returns 1 if user's input is "y", "Y", "yes" or "YES"
751 int confirm_yesno(void)
760 while (i < sizeof(str_input)) {
761 str_input[i] = getchar();
763 if (str_input[i] == '\r')
768 if (strncmp(str_input, "y\r", 2) == 0 ||
769 strncmp(str_input, "Y\r", 2) == 0 ||
770 strncmp(str_input, "yes\r", 4) == 0 ||
771 strncmp(str_input, "YES\r", 4) == 0)
775 /* pass 1 to disable ctrlc() checking, 0 to enable.
776 * returns previous state
778 int disable_ctrlc(int disable)
780 int prev = ctrlc_disabled; /* save previous state */
782 ctrlc_disabled = disable;
788 return ctrlc_was_pressed;
791 void clear_ctrlc(void)
793 ctrlc_was_pressed = 0;
796 /** U-Boot INIT FUNCTIONS *************************************************/
798 struct stdio_dev *search_device(int flags, const char *name)
800 struct stdio_dev *dev;
802 dev = stdio_get_by_name(name);
803 #ifdef CONFIG_VIDCONSOLE_AS_LCD
804 if (!dev && !strcmp(name, CONFIG_VIDCONSOLE_AS_NAME))
805 dev = stdio_get_by_name("vidconsole");
808 if (dev && (dev->flags & flags))
814 int console_assign(int file, const char *devname)
817 struct stdio_dev *dev;
819 /* Check for valid file */
822 flag = DEV_FLAGS_INPUT;
826 flag = DEV_FLAGS_OUTPUT;
832 /* Check for valid device name */
834 dev = search_device(flag, devname);
837 return console_setfile(file, dev);
842 /* return true if the 'silent' flag is removed */
843 static bool console_update_silent(void)
845 unsigned long flags = gd->flags;
847 if (!IS_ENABLED(CONFIG_SILENT_CONSOLE))
850 if (env_get("silent")) {
851 gd->flags |= GD_FLG_SILENT;
855 gd->flags &= ~GD_FLG_SILENT;
857 return !!(flags & GD_FLG_SILENT);
860 int console_announce_r(void)
862 #if !CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
863 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
865 display_options_get_banner(false, buf, sizeof(buf));
867 console_puts_select(stdout, false, buf);
873 /* Called before relocation - use serial functions */
874 int console_init_f(void)
876 gd->have_console = 1;
878 console_update_silent();
880 print_pre_console_buffer(PRE_CONSOLE_FLUSHPOINT1_SERIAL);
885 void stdio_print_current_devices(void)
887 /* Print information */
889 if (stdio_devices[stdin] == NULL) {
890 puts("No input devices available!\n");
892 printf ("%s\n", stdio_devices[stdin]->name);
896 if (stdio_devices[stdout] == NULL) {
897 puts("No output devices available!\n");
899 printf ("%s\n", stdio_devices[stdout]->name);
903 if (stdio_devices[stderr] == NULL) {
904 puts("No error devices available!\n");
906 printf ("%s\n", stdio_devices[stderr]->name);
910 #if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
911 /* Called after the relocation - use desired console functions */
912 int console_init_r(void)
914 char *stdinname, *stdoutname, *stderrname;
915 struct stdio_dev *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
920 /* update silent for env loaded from flash (initr_env) */
921 if (console_update_silent())
922 flushpoint = PRE_CONSOLE_FLUSHPOINT1_SERIAL;
924 flushpoint = PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL;
926 /* set default handlers at first */
927 gd->jt->getc = serial_getc;
928 gd->jt->tstc = serial_tstc;
929 gd->jt->putc = serial_putc;
930 gd->jt->puts = serial_puts;
931 gd->jt->printf = serial_printf;
933 /* stdin stdout and stderr are in environment */
935 stdinname = env_get("stdin");
936 stdoutname = env_get("stdout");
937 stderrname = env_get("stderr");
939 if (OVERWRITE_CONSOLE == 0) { /* if not overwritten by config switch */
940 inputdev = search_device(DEV_FLAGS_INPUT, stdinname);
941 outputdev = search_device(DEV_FLAGS_OUTPUT, stdoutname);
942 errdev = search_device(DEV_FLAGS_OUTPUT, stderrname);
943 if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
944 iomux_err = iomux_doenv(stdin, stdinname);
945 iomux_err += iomux_doenv(stdout, stdoutname);
946 iomux_err += iomux_doenv(stderr, stderrname);
948 /* Successful, so skip all the code below. */
952 /* if the devices are overwritten or not found, use default device */
953 if (inputdev == NULL) {
954 inputdev = search_device(DEV_FLAGS_INPUT, "serial");
956 if (outputdev == NULL) {
957 outputdev = search_device(DEV_FLAGS_OUTPUT, "serial");
959 if (errdev == NULL) {
960 errdev = search_device(DEV_FLAGS_OUTPUT, "serial");
962 /* Initializes output console first */
963 if (outputdev != NULL) {
964 /* need to set a console if not done above. */
965 console_doenv(stdout, outputdev);
967 if (errdev != NULL) {
968 /* need to set a console if not done above. */
969 console_doenv(stderr, errdev);
971 if (inputdev != NULL) {
972 /* need to set a console if not done above. */
973 console_doenv(stdin, inputdev);
978 if (!IS_ENABLED(CONFIG_SYS_CONSOLE_INFO_QUIET))
979 stdio_print_current_devices();
981 #ifdef CONFIG_VIDCONSOLE_AS_LCD
982 if (strstr(stdoutname, CONFIG_VIDCONSOLE_AS_NAME))
983 printf("Warning: Please change '%s' to 'vidconsole' in stdout/stderr environment vars\n",
984 CONFIG_VIDCONSOLE_AS_NAME);
987 if (IS_ENABLED(CONFIG_SYS_CONSOLE_ENV_OVERWRITE)) {
988 /* set the environment variables (will overwrite previous env settings) */
989 for (i = 0; i < MAX_FILES; i++)
990 env_set(stdio_names[i], stdio_devices[i]->name);
993 gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
996 /* If nothing usable installed, use only the initial console */
997 if ((stdio_devices[stdin] == NULL) && (stdio_devices[stdout] == NULL))
1000 print_pre_console_buffer(flushpoint);
1004 #else /* !CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */
1006 /* Called after the relocation - use desired console functions */
1007 int console_init_r(void)
1009 struct stdio_dev *inputdev = NULL, *outputdev = NULL;
1011 struct list_head *list = stdio_get_list();
1012 struct list_head *pos;
1013 struct stdio_dev *dev;
1016 /* update silent for env loaded from flash (initr_env) */
1017 if (console_update_silent())
1018 flushpoint = PRE_CONSOLE_FLUSHPOINT1_SERIAL;
1020 flushpoint = PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL;
1023 * suppress all output if splash screen is enabled and we have
1024 * a bmp to display. We redirect the output from frame buffer
1025 * console to serial console in this case or suppress it if
1026 * "silent" mode was requested.
1028 if (IS_ENABLED(CONFIG_SPLASH_SCREEN) && env_get("splashimage")) {
1029 if (!(gd->flags & GD_FLG_SILENT))
1030 outputdev = search_device (DEV_FLAGS_OUTPUT, "serial");
1033 /* Scan devices looking for input and output devices */
1034 list_for_each(pos, list) {
1035 dev = list_entry(pos, struct stdio_dev, list);
1037 if ((dev->flags & DEV_FLAGS_INPUT) && (inputdev == NULL)) {
1040 if ((dev->flags & DEV_FLAGS_OUTPUT) && (outputdev == NULL)) {
1043 if(inputdev && outputdev)
1047 /* Initializes output console first */
1048 if (outputdev != NULL) {
1049 console_setfile(stdout, outputdev);
1050 console_setfile(stderr, outputdev);
1051 console_devices_set(stdout, outputdev);
1052 console_devices_set(stderr, outputdev);
1055 /* Initializes input console */
1056 if (inputdev != NULL) {
1057 console_setfile(stdin, inputdev);
1058 console_devices_set(stdin, inputdev);
1061 if (!IS_ENABLED(CONFIG_SYS_CONSOLE_INFO_QUIET))
1062 stdio_print_current_devices();
1064 /* Setting environment variables */
1065 for (i = 0; i < MAX_FILES; i++) {
1066 env_set(stdio_names[i], stdio_devices[i]->name);
1069 gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
1072 /* If nothing usable installed, use only the initial console */
1073 if ((stdio_devices[stdin] == NULL) && (stdio_devices[stdout] == NULL))
1076 print_pre_console_buffer(flushpoint);
1080 #endif /* CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) */