arch/sim: add implemntation of 'host_sleep'.

Change-Id: Ib82343565ca9541499dec52c753c3f15923f7d1c
Signed-off-by: zhongan <zhongan@xiaomi.com>
This commit is contained in:
zhongan 2020-04-09 09:41:50 +08:00 committed by Alan Carvalho de Assis
parent a41c5e01e1
commit 4ff0edce25
3 changed files with 11 additions and 1 deletions

View File

@ -58,6 +58,15 @@ uint64_t host_gettime(bool rtc)
return 1000000000ull * tp.tv_sec + tp.tv_nsec;
}
/****************************************************************************
* Name: host_sleep
****************************************************************************/
void host_sleep(uint64_t nsec)
{
usleep(nsec);
}
/****************************************************************************
* Name: host_sleepuntil
****************************************************************************/

View File

@ -231,6 +231,7 @@ void *host_alloc_heap(size_t sz);
/* up_hosttime.c ************************************************************/
uint64_t host_gettime(bool rtc);
void host_sleep(uint64_t nsec);
void host_sleepuntil(uint64_t nsec);
/* up_simsmp.c **************************************************************/

View File

@ -229,7 +229,7 @@ int up_rptun_init(void)
while (g_dev.shmem->base == 0)
{
up_hostusleep(1000);
host_sleep(1000);
}
s_addrenv[0].va = (uintptr_t)g_dev.shmem;