hv:Reshuffle console/uart code

The current hierarchy :
  CONSOLE --> SERIAL -->UART DRIVER
This patch remove SERIAL layer, that is console will
call UART driver directly, change it to:
  CONSOLE  --> UART DRIVER
Remove some related data structures and registration and callback.
Cleanup vuart.c

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-07-27 16:23:09 +08:00
committed by lijinxia
parent b7436272e7
commit ae3004028b
12 changed files with 192 additions and 540 deletions

View File

@@ -16,16 +16,6 @@ extern struct hv_timer console_timer;
void console_init(void);
/** Writes a NUL terminated string to the console.
*
* @param str A pointer to the NUL terminated string to write.
*
* @return The number of characters written or -1 if an error occurred
* and no character was written.
*/
int console_puts(const char *s_arg);
/** Writes a given number of characters to the console.
*
* @param str A pointer to character array to write.
@@ -45,7 +35,9 @@ int console_write(const char *s_arg, size_t len);
* occurred before any character was written.
*/
int console_putc(int ch);
void console_putc(const char *ch);
char console_getc(void);
int console_gets(char *buffer, uint32_t length);
void console_setup_timer(void);
@@ -65,20 +57,16 @@ static inline void resume_console(void)
static inline void console_init(void)
{
}
static inline int console_puts(__unused const char *str)
{
return 0;
}
static inline int console_write(__unused const char *str,
__unused size_t len)
{
return 0;
}
static inline int console_putc(__unused int ch)
{
return 0;
}
static inline void console_putc(__unused const char *ch) { }
static inline int console_getc(void) { return 0; }
static inline int console_gets(char *buffer, uint32_t length) { return 0; }
static inline void console_setup_timer(void) {}
static inline uint32_t get_serial_handle(void) { return 0; }

View File

@@ -63,8 +63,8 @@ struct vuart {
#ifdef HV_DEBUG
void *vuart_init(struct vm *vm);
struct vuart *vuart_console_active(void);
void vuart_console_tx_chars(void);
void vuart_console_rx_chars(uint32_t serial_handle);
void vuart_console_tx_chars(struct vuart *vu);
void vuart_console_rx_chars(struct vuart *vu);
#else
static inline void *vuart_init(__unused struct vm *vm)
{
@@ -74,11 +74,8 @@ static inline struct vuart *vuart_console_active(void)
{
return NULL;
}
static inline void vuart_console_tx_chars(void) {}
static inline void vuart_console_rx_chars(
__unused uint32_t serial_handle)
{
}
static inline void vuart_console_tx_chars(__unused struct vuart *vu) {}
static inline void vuart_console_rx_chars(__unused struct vuart *vu) {}
#endif /*HV_DEBUG*/
#endif

View File

@@ -8,7 +8,6 @@
#define HV_DEBUG_H
#include <logmsg.h>
#include <serial.h>
#include <vuart.h>
#include <console.h>
#include <dump.h>