void initSystem(void (*retAddr)(void)) { __libctru_init(retAddr); __appInit(); __system_initArgv(); __libc_init_array(); }
void __attribute__((weak)) __libctru_init(void (*retAddr)(void)) { // Register newlib exit() syscall __syscalls.exit = __ctru_exit; __syscalls.gettod_r = __libctru_gtod; __system_retAddr = __service_ptr ? retAddr : NULL; if (__sync_init) __sync_init(); __system_allocateHeaps(); // Build argc/argv if present __system_initArgv(); }
void __attribute__((weak)) __libctru_init(void (*retAddr)(void)) { // Store the return address __system_retAddr = envIsHomebrew() ? retAddr : NULL; // Initialize the synchronization subsystem __sync_init(); // Initialize newlib support system calls __system_initSyscalls(); // Allocate application and linear heaps __system_allocateHeaps(); // Build argc/argv if present __system_initArgv(); }