/**
 * @file hv_vos_Stdio.c
 * @brief vos stdio source code 
 * @details 
 * @author HiView SoC Software Team
 * @version 0.0.1
 * @date 20230301
 * @copyright Copyright(c),2023-3, Hiview Software. All rights reserved.
 * @par History: 
 * <table>
 * <tr><th>author                     <th>date           <th>description
 * <tr><td>HiView SoC Software Team   <td>20230301       <td>Create and first Version.
 * </table>
**/

#include "hv_vos_Types.h"
#include "hv_vos_Assert.h"
#include "hv_vos_Cache.h"
#include "hv_chip_Config.h"

void Hv_Vos_InitStdio(void)
{
    return;
}

void Hv_Vos_CleanupStdio(void)
{
    /* Flush the caches */
    Hv_Vos_InvalidAllCache();
}

int Hv_Vos_STDIO_GetChar(char* ch)
{
    return Hv_Chip_DebugUartGetc(ch);
}

void Hv_Vos_STDIO_PutChar(int ch)
{
    Hv_Chip_DebugUartPutc(ch);
}

void Hv_Vos_STDIO_FFlush(void)
{
}

int Hv_Vos_STDIO_KBHit(void)
{
    return Hv_Chip_DebugUartKbhit();
}


void __abort(void)
{
    HV_ASSERT_NOT_IMPL();
}
#if 1
void *sbrk(intptr_t increment)
{
    HV_ASSERT_NOT_IMPL();
    return NULL;
}
#endif

void *malloc(size_t size)
{
    HV_ASSERT_NOT_IMPL();
    return NULL;
}

void free(void *ptr)
{
    HV_ASSERT_NOT_IMPL();
}

void *calloc(size_t nmemb, size_t size)
{
    HV_ASSERT_NOT_IMPL();
    return NULL;
}

void *realloc(void *ptr, size_t size)
{
    HV_ASSERT_NOT_IMPL();
    return NULL;
}


