[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:
Justin C. Miller
2022-02-06 21:39:04 -08:00
parent 5ddac353a0
commit 346c172b32
90 changed files with 9848 additions and 25 deletions

View File

@@ -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