ppc64: Don't set Kp bit on SLB
[openbios.git] / arch / sparc64 / console.c
blobb4b4b767c867e9ce7652161daad84dab82733686
1 /*
2 * Copyright (C) 2003, 2004 Stefan Reinauer
4 * See the file "COPYING" for further information about
5 * the copyright and warranty status of this work.
6 */
8 #include "config.h"
9 #include "libopenbios/bindings.h"
10 #include "kernel/kernel.h"
11 #include "drivers/drivers.h"
12 #include "libopenbios/fontdata.h"
13 #include "openbios.h"
14 #include "libc/vsprintf.h"
15 #include "libopenbios/sys_info.h"
16 #include "boot.h"
18 /* ******************************************************************
19 * simple polling video/keyboard console functions
20 * ****************************************************************** */
22 #ifdef CONFIG_DEBUG_CONSOLE
23 /* ******************************************************************
24 * common functions, implementing simple concurrent console
25 * ****************************************************************** */
27 int putchar(int c)
29 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
30 serial_putchar(c);
31 #endif
32 return c;
35 int availchar(void)
37 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
38 if (uart_charav(CONFIG_SERIAL_PORT))
39 return 1;
40 #endif
41 #ifdef CONFIG_DEBUG_CONSOLE_VGA
42 if (pc_kbd_dataready())
43 return 1;
44 #endif
45 return 0;
48 int getchar(void)
50 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
51 if (uart_charav(CONFIG_SERIAL_PORT))
52 return (uart_getchar(CONFIG_SERIAL_PORT));
53 #endif
54 #ifdef CONFIG_DEBUG_CONSOLE_VGA
55 if (pc_kbd_dataready())
56 return (pc_kbd_readdata());
57 #endif
58 return 0;
61 void cls(void)
63 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
64 serial_putchar(27);
65 serial_putchar('[');
66 serial_putchar('H');
67 serial_putchar(27);
68 serial_putchar('[');
69 serial_putchar('J');
70 #endif
73 #endif // CONFIG_DEBUG_CONSOLE