serial: remove putConsoleChar
putConsoleChar was needless indirection around putDebugChar. Remove this.
This commit is contained in:
parent
4235cb9f4b
commit
7b019e3def
6 changed files with 6 additions and 39 deletions
|
|
@ -19,8 +19,6 @@
|
|||
__attribute__((format(archetype, string_index, first_to_check)))
|
||||
|
||||
#if (defined CONFIG_DEBUG_BUILD) || (defined CONFIG_PRINTING)
|
||||
/* most arm platforms just call this for putConsoleChar, so
|
||||
* prototype it here */
|
||||
void putDebugChar(unsigned char c);
|
||||
#endif
|
||||
|
||||
|
|
@ -31,7 +29,6 @@ unsigned char getDebugChar(void);
|
|||
|
||||
#ifdef CONFIG_PRINTING
|
||||
/* printf will result in output */
|
||||
void putConsoleChar(unsigned char c);
|
||||
void putchar(char c);
|
||||
#define kernel_putchar(c) putchar(c)
|
||||
word_t kprintf(const char *format, ...) VISIBLE FORMAT(printf, 1, 2);
|
||||
|
|
|
|||
|
|
@ -392,7 +392,6 @@ add_sources(
|
|||
kernel/thread.c
|
||||
machine/cache.c
|
||||
machine/errata.c
|
||||
machine/io.c
|
||||
machine/debug.c
|
||||
object/interrupt.c
|
||||
object/tcb.c
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* Copyright 2017, Data61
|
||||
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
||||
* ABN 41 687 119 230.
|
||||
*
|
||||
* This software may be distributed and modified according to the terms of
|
||||
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
|
||||
* See "LICENSE_GPLv2.txt" for details.
|
||||
*
|
||||
* @TAG(DATA61_GPL)
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <machine/io.h>
|
||||
|
||||
#ifdef CONFIG_PRINTING
|
||||
void
|
||||
putConsoleChar(unsigned char c)
|
||||
{
|
||||
putDebugChar(c);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -106,7 +106,7 @@ void handle_exception(void)
|
|||
|
||||
#ifdef CONFIG_PRINTING
|
||||
void
|
||||
putConsoleChar(unsigned char c)
|
||||
putDebugChar(unsigned char c)
|
||||
{
|
||||
sbi_console_putchar(c);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@
|
|||
void
|
||||
putchar(char c)
|
||||
{
|
||||
putConsoleChar(c);
|
||||
putDebugChar(c);
|
||||
if (c == '\n') {
|
||||
putConsoleChar('\r');
|
||||
putDebugChar('\r');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,18 +31,7 @@ serial_init(uint16_t port)
|
|||
in8(port + 5); /* clear line status port */
|
||||
in8(port + 6); /* clear modem status port */
|
||||
}
|
||||
#endif /* CONFIG_PRINTING || CONFIG_DEBUG_BUILD */
|
||||
|
||||
#ifdef CONFIG_PRINTING
|
||||
void
|
||||
putConsoleChar(unsigned char a)
|
||||
{
|
||||
while (x86KSconsolePort && !(in8(x86KSconsolePort + 5) & 0x20));
|
||||
out8(x86KSconsolePort, a);
|
||||
}
|
||||
#endif /* CONFIG_PRINTING */
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUILD
|
||||
void
|
||||
putDebugChar(unsigned char a)
|
||||
{
|
||||
|
|
@ -50,6 +39,9 @@ putDebugChar(unsigned char a)
|
|||
out8(x86KSdebugPort, a);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PRINTING || CONFIG_DEBUG_BUILD */
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUILD
|
||||
unsigned char
|
||||
getDebugChar(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue