Skip to content

Commit a6c38f5

Browse files
committed
Using posix thread implemention for NuttX
Signed-off-by: Huang Qi <[email protected]>
1 parent a84d512 commit a6c38f5

File tree

4 files changed

+5
-92
lines changed

4 files changed

+5
-92
lines changed

core/shared/platform/nuttx/nuttx_platform.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,3 @@ os_mprotect(void *addr, size_t size, int prot)
5757
void
5858
os_dcache_flush()
5959
{}
60-
61-
uint64
62-
os_time_get_boot_microsecond()
63-
{
64-
struct timespec ts;
65-
if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
66-
return 0;
67-
}
68-
69-
return ((uint64)ts.tv_sec) * 1000 * 1000 + ((uint64)ts.tv_nsec) / 1000;
70-
}

core/shared/platform/nuttx/nuttx_thread.c

Lines changed: 0 additions & 80 deletions
This file was deleted.

core/shared/platform/nuttx/platform_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <stdlib.h>
1717
#include <string.h>
1818
#include <math.h>
19+
#include <sys/time.h>
20+
#include <sys/mman.h>
1921

2022
#ifdef __cplusplus
2123
extern "C" {

product-mini/platforms/nuttx/wamr.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ CFLAGS += -I${IWASM_ROOT}/interpreter
153153
endif
154154

155155
CSRCS += nuttx_platform.c \
156-
nuttx_thread.c \
156+
posix_thread.c \
157+
posix_time.c \
157158
mem_alloc.c \
158159
ems_kfc.c \
159160
ems_alloc.c \
@@ -176,6 +177,7 @@ CSRCS += nuttx_platform.c \
176177
ASRCS += ${INVOKE_NATIVE}
177178

178179
VPATH += ${SHARED_ROOT}/platform/nuttx
180+
VPATH += ${SHARED_ROOT}/platform/common/posix
179181
VPATH += ${SHARED_ROOT}/mem-alloc
180182
VPATH += ${SHARED_ROOT}/mem-alloc/ems
181183
VPATH += ${SHARED_ROOT}/utils

0 commit comments

Comments
 (0)