hv:Remove dead code in console.c

Remove this API console_dump_bytes

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-23 15:50:08 +08:00 committed by lijinxia
parent a661ffa618
commit ff05a6e8b9
2 changed files with 1 additions and 47 deletions

View File

@ -135,38 +135,6 @@ int console_write(const char *s, size_t len)
return res; return res;
} }
void console_dump_bytes(const void *p, unsigned int len)
{
const unsigned char *x = p;
const unsigned char *e = x + len;
int i;
/* dump all bytes */
while (x < e) {
/* write the address of the first byte in the row */
printf("%08x: ", (uint64_t) x);
/* print one row (16 bytes) as hexadecimal values */
for (i = 0; i < 16; i++) {
printf("%02x ", x[i]);
}
/* print one row as ASCII characters (if possible) */
for (i = 0; i < 16; i++) {
if ((x[i] < ' ') || (x[i] >= 127)) {
(void)console_putc('.');
}
else {
(void)console_putc(x[i]);
}
}
/* continue with next row */
(void)console_putc('\n');
/* set pointer one row ahead */
x += 16;
}
}
static void console_read(void) static void console_read(void)
{ {
spinlock_obtain(&lock); spinlock_obtain(&lock);

View File

@ -47,17 +47,6 @@ int console_write(const char *str, size_t len);
int console_putc(int ch); int console_putc(int ch);
/** Dumps an array to the console.
*
* This function dumps an array of bytes to the console
* in a hexadecimal format.
*
* @param p A pointer to the byte array to dump.
* @param len The number of bytes to dump.
*/
void console_dump_bytes(const void *p, unsigned int len);
void console_setup_timer(void); void console_setup_timer(void);
uint32_t get_serial_handle(void); uint32_t get_serial_handle(void);
@ -89,10 +78,7 @@ static inline int console_putc(__unused int ch)
{ {
return 0; return 0;
} }
static inline void console_dump_bytes(__unused const void *p,
__unused unsigned int len)
{
}
static inline void console_setup_timer(void) {} static inline void console_setup_timer(void) {}
static inline uint32_t get_serial_handle(void) { return 0; } static inline uint32_t get_serial_handle(void) { return 0; }