mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00
Merge "refactor(console): move putchar() to console driver" into integration
This commit is contained in:
commit
c19116dd61
2 changed files with 13 additions and 11 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <drivers/console.h>
|
||||
|
||||
|
@ -96,10 +97,17 @@ int console_putc(int c)
|
|||
if ((err == ERROR_NO_VALID_CONSOLE) || (ret < err))
|
||||
err = ret;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int putchar(int c)
|
||||
{
|
||||
if (console_putc(c) == 0)
|
||||
return c;
|
||||
else
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int console_getc(void)
|
||||
{
|
||||
int err = ERROR_NO_VALID_CONSOLE;
|
||||
|
|
|
@ -6,15 +6,9 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <drivers/console.h>
|
||||
|
||||
int putchar(int c)
|
||||
int __putchar(int c)
|
||||
{
|
||||
int res;
|
||||
if (console_putc((unsigned char)c) >= 0)
|
||||
res = c;
|
||||
else
|
||||
res = EOF;
|
||||
|
||||
return res;
|
||||
return c;
|
||||
}
|
||||
|
||||
int putchar(int c) __attribute__((weak,alias("__putchar")));
|
||||
|
|
Loading…
Add table
Reference in a new issue