/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2014-2020. All rights reserved. * Description: stdio * Author: SmartMedia_BSP * Create: 2014-06-04 */ #ifndef STDIOH #define STDIOH #include #include #ifdef CONFIG_PRINT extern int printf(const char *cfmt, ...); extern int getchar(void); extern int getc(void); extern void putchar(unsigned int c); extern void putc(unsigned int c); extern int tstchar(void); extern int isbreak(void); extern int puts(const char *s); # include # define early_printf(_cfmt, args...) uart_early_printf(_cfmt, ##args) # define early_puts(_ss) uart_early_puts(_ss) #else /* getchar/putchar/tstchar is need for bootstrap */ extern int getchar(void); extern void putchar(unsigned int c); extern int tstchar(void); # define printf(_cfmt, ...) # define getc() # define putc(_c) # define puts(_s) # define isbreak() 0 # define early_printf(_cfmt, args...) # define early_puts(_ss) # define uart_early_puts(ss) # define uart_early_put_hex(hex) # define uart_early_putc(chr) #endif #ifdef CONFIG_SUPPORT_TOOLPLATFORM extern int printf_to_toolplatform(const char *cfmt, ...); /* printf message for tool */ #define PR_TOOL printf_to_toolplatform #else #define PR_TOOL #endif char *u64tohstr(const uint64 size, char *unit); char *u32tohstr(const uint32 size, char *unit); char *u32tohhstr(uint32 size); char *u64tohhstr(uint64 size); char *ultohstr(unsigned long long size); #endif /* STDIOH */