baremetal: remove unnecessary functions
This commit is contained in:
@ -28,71 +28,11 @@ os_dumps_proc_mem_info(char *out, unsigned int size)
|
||||
return -1;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void
|
||||
bh_print_proc_mem(const char *prompt)
|
||||
{
|
||||
}
|
||||
|
||||
__attribute__((weak)) void
|
||||
bh_log_proc_mem(const char *function, uint32 line)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************
|
||||
* string
|
||||
****************************************************/
|
||||
|
||||
// void *
|
||||
// memcpy(void *restrict dest, const void *restrict src, size_t n)
|
||||
// {
|
||||
// unsigned char *d = (unsigned char *)dest;
|
||||
// const unsigned char *s = (const unsigned char *)src;
|
||||
//
|
||||
// while (n--)
|
||||
// *d++ = *s++;
|
||||
//
|
||||
// return dest;
|
||||
// }
|
||||
//
|
||||
// void *
|
||||
// memmove(void *dest, const void *src, size_t n)
|
||||
// {
|
||||
// unsigned char *d = (unsigned char *)dest;
|
||||
// const unsigned char *s = (const unsigned char *)src;
|
||||
//
|
||||
// if (d == s || n == 0)
|
||||
// return dest;
|
||||
//
|
||||
// if (d < s) {
|
||||
// /* forward copy */
|
||||
// while (n--)
|
||||
// *d++ = *s++;
|
||||
// }
|
||||
// else {
|
||||
// /* backward copy */
|
||||
// d += n;
|
||||
// s += n;
|
||||
// while (n--)
|
||||
// *--d = *--s;
|
||||
// }
|
||||
//
|
||||
// return dest;
|
||||
// }
|
||||
//
|
||||
// void *
|
||||
// memset(void *dest, int c, size_t n)
|
||||
// {
|
||||
// unsigned char *p = dest;
|
||||
// while (n--)
|
||||
// *p++ = (unsigned char)c;
|
||||
// return dest;
|
||||
// }
|
||||
|
||||
/****************************************************
|
||||
* mman
|
||||
****************************************************/
|
||||
|
||||
// NOTE: We need os_mmap for aot_load_from_aot_file
|
||||
// Need os_mmap for aot_load_from_aot_file
|
||||
//
|
||||
// Stacktrace:
|
||||
// #5 0x0805e5c1 in os_mmap
|
||||
@ -104,7 +44,7 @@ bh_log_proc_mem(const char *function, uint32 line)
|
||||
// #11 0x08048cff in wasm_runtime_load
|
||||
// #12 0x08048112 in main
|
||||
|
||||
#define MMAP_SPACE_SIZE (2 * 1024 * 1024)
|
||||
// I hope this isn't too simple
|
||||
static uint8_t mmap_space[MMAP_SPACE_SIZE];
|
||||
static size_t mmap_offset = 0; // Free space begins here
|
||||
|
||||
@ -166,22 +106,6 @@ os_mprotect(void *addr, size_t size, int prot)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************
|
||||
* math
|
||||
****************************************************/
|
||||
|
||||
double
|
||||
sqrt(double x)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float
|
||||
sqrtf(float x)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/****************************************************
|
||||
* Section 1 *
|
||||
* Interfaces required by the runtime *
|
||||
|
||||
@ -3,13 +3,14 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
// #include <assert.h>
|
||||
// #include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
// #include <assert.h>
|
||||
// #include <time.h>
|
||||
// #include <ctype.h>
|
||||
// #include <pthread.h>
|
||||
// #include <signal.h>
|
||||
@ -42,6 +43,9 @@ extern "C" {
|
||||
#define BH_APPLET_PRESERVED_STACK_SIZE (8 * 1024)
|
||||
#define BH_THREAD_DEFAULT_PRIORITY 0
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
#define MMAP_SPACE_SIZE (2 * 1024 * 1024)
|
||||
|
||||
typedef int korp_tid;
|
||||
typedef struct {
|
||||
int dummy;
|
||||
@ -74,21 +78,12 @@ os_get_invalid_handle(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
|
||||
static inline int
|
||||
os_getpagesize()
|
||||
{
|
||||
return PAGE_SIZE;
|
||||
}
|
||||
|
||||
// void *
|
||||
// memcpy(void *restrict dest, const void *restrict src, size_t n);
|
||||
// void *
|
||||
// memmove(void *dest, const void *src, size_t n);
|
||||
// void *
|
||||
// memset(void *dest, int c, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -5,8 +5,6 @@ add_definitions(-DBH_PLATFORM_BAREMETAL)
|
||||
include_directories(${PLATFORM_SHARED_DIR})
|
||||
|
||||
include_directories(${PLATFORM_SHARED_DIR}/../include)
|
||||
# file (GLOB header ${PLATFORM_SHARED_DIR}/../include/baremetal/*.h)
|
||||
# list (APPEND RUNTIME_LIB_HEADER_LIST ${header})
|
||||
|
||||
file (GLOB_RECURSE source_all ${PLATFORM_SHARED_DIR}/*.c)
|
||||
set (PLATFORM_SHARED_SOURCE ${source_all})
|
||||
|
||||
Reference in New Issue
Block a user