re-org platform APIs, simplify porting process (#201)

Co-authored-by: Xu Jun <jun1.xu@intel.com>
This commit is contained in:
Xu Jun
2020-03-16 16:43:57 +08:00
committed by GitHub
parent ef5ceffe71
commit f1a0e75ab7
177 changed files with 2954 additions and 7904 deletions

View File

@ -16,7 +16,7 @@ int gci_check_platform()
{
#define CHECK(x, y) do { \
if((x) != (y)) { \
bh_printf("Platform checking failed on LINE %d at FILE %s.",\
os_printf("Platform checking failed on LINE %d at FILE %s.",\
__LINE__, __FILE__); \
return GC_ERROR; \
} \
@ -48,12 +48,12 @@ gc_handle_t gc_init_with_pool(char *buf, gc_size_t buf_size)
/* check system compatibility*/
if (gci_check_platform() == GC_ERROR) {
bh_printf("Check platform compatibility failed");
os_printf("Check platform compatibility failed");
return NULL;
}
if (buf_size < 1024) {
bh_printf("[GC_ERROR]heap_init_size(%d) < 1024", buf_size);
os_printf("[GC_ERROR]heap_init_size(%d) < 1024", buf_size);
return NULL;
}
@ -65,12 +65,12 @@ gc_handle_t gc_init_with_pool(char *buf, gc_size_t buf_size)
ret = gct_vm_mutex_init(&heap->lock);
if (ret != BHT_OK) {
bh_printf("[GC_ERROR]failed to init lock ");
os_printf("[GC_ERROR]failed to init lock ");
return NULL;
}
#ifdef BH_FOOTPRINT
bh_printf("\nINIT HEAP 0x%08x %d\n", base_addr, heap_max_size);
os_printf("\nINIT HEAP 0x%08x %d\n", base_addr, heap_max_size);
#endif
/* init all data structures*/
@ -117,8 +117,8 @@ gc_handle_t gc_init_with_pool(char *buf, gc_size_t buf_size)
&& HMU_FC_NORMAL_MAX_SIZE < q->size); /*@NOTIFY*/
#if BH_ENABLE_MEMORY_PROFILING != 0
bh_printf("heap is successfully initialized with max_size=%u.",
heap_max_size);
os_printf("heap is successfully initialized with max_size=%u.",
heap_max_size);
#endif
return heap;
}