mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2026-07-06 10:45:39 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
21
Living_SDK/kernel/cplusplus/cpp_init.c
Normal file
21
Living_SDK/kernel/cplusplus/cpp_init.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
typedef void (*cpp_func) ();
|
||||
extern cpp_func __ctors_start__[];
|
||||
extern cpp_func __ctors_end__[];
|
||||
|
||||
__attribute__((weak)) void * __dso_handle = 0;
|
||||
|
||||
void cpp_init(void)
|
||||
{
|
||||
cpp_func *f;
|
||||
|
||||
for (f = __ctors_start__; f < __ctors_end__; f++) {
|
||||
(*f)();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
27
Living_SDK/kernel/cplusplus/cpp_mem.cpp
Normal file
27
Living_SDK/kernel/cplusplus/cpp_mem.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#include <k_api.h>
|
||||
#include "cpp_mem.h"
|
||||
|
||||
void *operator new[](size_t size)
|
||||
{
|
||||
return krhino_mm_alloc(size);
|
||||
}
|
||||
|
||||
void *operator new(size_t size)
|
||||
{
|
||||
return krhino_mm_alloc(size);
|
||||
}
|
||||
|
||||
void operator delete[](void *ptr)
|
||||
{
|
||||
krhino_mm_free(ptr);
|
||||
}
|
||||
|
||||
void operator delete(void *ptr)
|
||||
{
|
||||
krhino_mm_free(ptr);
|
||||
}
|
||||
|
||||
11
Living_SDK/kernel/cplusplus/cpp_mem.h
Normal file
11
Living_SDK/kernel/cplusplus/cpp_mem.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef CPP_MEM_H
|
||||
void *operator new[](size_t size);
|
||||
void *operator new(size_t size);
|
||||
void operator delete[](void *ptr);
|
||||
void operator delete(void *ptr);
|
||||
#endif
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue