arch/sim: add implemntation of 'host_sleep'.
Change-Id: Ib82343565ca9541499dec52c753c3f15923f7d1c Signed-off-by: zhongan <zhongan@xiaomi.com>
This commit is contained in:
parent
a41c5e01e1
commit
4ff0edce25
@ -58,6 +58,15 @@ uint64_t host_gettime(bool rtc)
|
|||||||
return 1000000000ull * tp.tv_sec + tp.tv_nsec;
|
return 1000000000ull * tp.tv_sec + tp.tv_nsec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: host_sleep
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void host_sleep(uint64_t nsec)
|
||||||
|
{
|
||||||
|
usleep(nsec);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: host_sleepuntil
|
* Name: host_sleepuntil
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -231,6 +231,7 @@ void *host_alloc_heap(size_t sz);
|
|||||||
/* up_hosttime.c ************************************************************/
|
/* up_hosttime.c ************************************************************/
|
||||||
|
|
||||||
uint64_t host_gettime(bool rtc);
|
uint64_t host_gettime(bool rtc);
|
||||||
|
void host_sleep(uint64_t nsec);
|
||||||
void host_sleepuntil(uint64_t nsec);
|
void host_sleepuntil(uint64_t nsec);
|
||||||
|
|
||||||
/* up_simsmp.c **************************************************************/
|
/* up_simsmp.c **************************************************************/
|
||||||
|
@ -229,7 +229,7 @@ int up_rptun_init(void)
|
|||||||
|
|
||||||
while (g_dev.shmem->base == 0)
|
while (g_dev.shmem->base == 0)
|
||||||
{
|
{
|
||||||
up_hostusleep(1000);
|
host_sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
s_addrenv[0].va = (uintptr_t)g_dev.shmem;
|
s_addrenv[0].va = (uintptr_t)g_dev.shmem;
|
||||||
|
Loading…
Reference in New Issue
Block a user