Skip to content

Commit dc21c62

Browse files
authored
Add missing functions to make RIOT work with the 2.x.x version (#3508)
The `os_mremap` and `os_getpagesize` were missing in the `core/shared/platform/riot` and were preventing RIOT from compiling if using WAMR v2.x.x. This PR is adding both functions and should allow RIOT to update WAMR version to v2.x.x. Signed-off-by:: mewen.berthelot <mewen.berthelot@orange.com>
1 parent 8f86b37 commit dc21c62

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

core/shared/platform/riot/platform_internal.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,12 @@ os_get_invalid_handle()
9494
return -1;
9595
}
9696

97+
/* There is no MMU in RIOT so the function return 1024 to make the compiler
98+
happy */
99+
static inline int
100+
os_getpagesize()
101+
{
102+
return 1024;
103+
}
104+
97105
#endif /* end of _BH_PLATFORM_H */

core/shared/platform/riot/riot_platform.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
5757
return BH_MALLOC((unsigned)size);
5858
}
5959

60+
void *
61+
os_mremap(void *old_addr, size_t old_size, size_t new_size)
62+
{
63+
return os_mremap_slow(old_addr, old_size, new_size);
64+
}
65+
6066
void
6167
os_munmap(void *addr, size_t size)
6268
{

0 commit comments

Comments
 (0)