btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / arch / arm / arch_debug_console.cpp
blobb76b32547fd2869b543776b1c5a981279151efbf
1 /*
2 * Copyright 2007, François Revol, revol@free.fr.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de.
6 * Distributed under the terms of the MIT License.
8 * Copyright 2001, Travis Geiselbrecht. All rights reserved.
9 * Distributed under the terms of the NewOS License.
13 //#include <arch_platform.h>
14 #include <arch/debug_console.h>
15 #include <arch/generic/debug_uart.h>
16 #include <boot/kernel_args.h>
17 #include <kernel.h>
18 #include <vm/vm.h>
19 #include <string.h>
22 // TODO: Declare this in some header
23 DebugUART *gArchDebugUART;
24 extern DebugUART *debug_uart_from_fdt(const void *fdt);
27 void
28 arch_debug_remove_interrupt_handler(uint32 line)
33 void
34 arch_debug_install_interrupt_handlers(void)
39 int
40 arch_debug_blue_screen_try_getchar(void)
42 // TODO: Implement correctly!
43 return arch_debug_blue_screen_getchar();
47 char
48 arch_debug_blue_screen_getchar(void)
50 return arch_debug_serial_getchar();
54 int
55 arch_debug_serial_try_getchar(void)
57 // TODO: Implement correctly!
58 return arch_debug_serial_getchar();
62 char
63 arch_debug_serial_getchar(void)
65 return gArchDebugUART->GetChar(false);
69 void
70 arch_debug_serial_putchar(const char c)
72 gArchDebugUART->PutChar(c);
76 void
77 arch_debug_serial_puts(const char *s)
79 while (*s != '\0') {
80 arch_debug_serial_putchar(*s);
81 s++;
86 void
87 arch_debug_serial_early_boot_message(const char *string)
89 // this function will only be called in fatal situations
90 arch_debug_serial_puts(string);
94 status_t
95 arch_debug_console_init(kernel_args *args)
97 // first try with hints from the FDT
98 gArchDebugUART = debug_uart_from_fdt(args->platform_args.fdt);
100 // Do we can some kind of direct fallback here
101 // (aka, guess arch_get_uart_pl011 or arch_get_uart_8250?)
102 if (gArchDebugUART == NULL)
103 return B_ERROR;
105 gArchDebugUART->InitEarly();
107 return B_OK;
111 status_t
112 arch_debug_console_init_settings(kernel_args *args)
114 return B_OK;