[libc] Add new libc
This new libc is mostly from scratch, with *printf() functions provided by Marco Paland and Eyal Rozenberg's tiny printf library, and malloc and friends provided by dlmalloc.
This commit is contained in:
@@ -2,21 +2,22 @@
|
||||
// but should not include the user-specific code.
|
||||
#ifndef __j6kernel
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <j6/errors.h>
|
||||
#include <j6/init.h>
|
||||
#include <j6/syscalls.h>
|
||||
#include <j6/types.h>
|
||||
|
||||
j6_handle_t __handle_sys = j6_handle_invalid;
|
||||
j6_handle_t __handle_self = j6_handle_invalid;
|
||||
j6_handle_t __handle_sys;
|
||||
j6_handle_t __handle_self;
|
||||
|
||||
namespace {
|
||||
constexpr size_t __static_arr_size = 4;
|
||||
j6_handle_t __handle_array[__static_arr_size];
|
||||
|
||||
static j6_status_t
|
||||
__load_handles()
|
||||
load_handles()
|
||||
{
|
||||
size_t count = __static_arr_size;
|
||||
j6_handle_t *handles = __handle_array;
|
||||
@@ -41,9 +42,10 @@ namespace {
|
||||
} // namespace
|
||||
|
||||
extern "C" void
|
||||
_init_libj6(uint64_t *rsp)
|
||||
__init_libj6(uint64_t *rsp)
|
||||
{
|
||||
__load_handles();
|
||||
__handle_sys = __handle_self = j6_handle_invalid;
|
||||
load_handles();
|
||||
}
|
||||
|
||||
#endif // __j6kernel
|
||||
|
||||
Reference in New Issue
Block a user