wut/libraries/wutnewlib/wut_newlib.c
fincs ee3bb10df4 First pass at adopting a devkitPro-style build system, see details:
- Added wut_rules and wut/rpx/rpl.specs to share/
- Replaced wut's CMake-based buildsystem with a standard Makefile
- Conflated all wut libraries into a single libwut.a library
- wut's old buildsystems (CMake & plain make) are broken as a result,
  this will be fixed in the future
- Docs, tests and samples are not buildable either at the moment
- wutcrt/wutnewlib:
  - RPX start function is __rpx_start, while RPL is __rpl_start
  - __init/fini_wut_* functions are no longer weak
  - __init_wut/__fini_wut are instead weak
  - Removed _exit implementation
  - exit syscall now points to _Exit instead of pointing to itself
- wutstdc++:
  - Renamed .cc files to .cpp
  - Temporarily disabled, due to an issue that will be addressed shortly
- wutdevoptab:
  - Fixed uninitialized variable warnings in __wut_fs_read/write
2019-02-12 12:46:28 +01:00

38 lines
935 B
C

#include "wut_newlib.h"
#include <coreinit/exit.h>
// Forward newlib _exit to the coreinit.rpl _Exit
extern void _Exit(int status);
static void
__init_wut_syscall_array()
{
__syscalls.sbrk_r = __wut_sbrk_r;
__syscalls.lock_init = __wut_lock_init;
__syscalls.lock_close = __wut_lock_close;
__syscalls.lock_acquire = __wut_lock_acquire;
__syscalls.lock_release = __wut_lock_release;
__syscalls.malloc_lock = __wut_malloc_lock;
__syscalls.malloc_unlock = __wut_malloc_unlock;
__syscalls.exit = _Exit;
__syscalls.gettod_r = __wut_gettod_r;
__syscalls.clock_gettime = __wut_clock_gettime;
__syscalls.clock_settime = __wut_clock_settime;
__syscalls.clock_getres = __wut_clock_getres;
__syscalls.nanosleep = __wut_nanosleep;
}
void
__init_wut_newlib()
{
__init_wut_sbrk_heap();
__init_wut_malloc_lock();
__init_wut_syscall_array();
}
void
__fini_wut_newlib()
{
__fini_wut_sbrk_heap();
}