Minor internal cleanup
This commit is contained in:
parent
1442eef9e4
commit
8e3c9f9784
@ -29,7 +29,7 @@ before_deploy:
|
|||||||
- sh .travis/exportdoc.sh
|
- sh .travis/exportdoc.sh
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: pages:git
|
provider: pages
|
||||||
deploy_key: .travis/id_travis_deploy
|
deploy_key: .travis/id_travis_deploy
|
||||||
edge: true
|
edge: true
|
||||||
keep_history: false
|
keep_history: false
|
||||||
|
@ -10,12 +10,7 @@ extern u32 __ctru_linear_heap_size;
|
|||||||
extern void (*__system_retAddr)(void);
|
extern void (*__system_retAddr)(void);
|
||||||
|
|
||||||
void envDestroyHandles(void);
|
void envDestroyHandles(void);
|
||||||
|
Result __sync_fini(void);
|
||||||
void __appExit();
|
|
||||||
|
|
||||||
void __libc_fini_array(void);
|
|
||||||
|
|
||||||
Result __sync_fini(void) __attribute__((weak));
|
|
||||||
|
|
||||||
void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
|
void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
|
||||||
{
|
{
|
||||||
@ -30,8 +25,8 @@ void __attribute__((weak)) __attribute__((noreturn)) __libctru_exit(int rc)
|
|||||||
// Close some handles
|
// Close some handles
|
||||||
envDestroyHandles();
|
envDestroyHandles();
|
||||||
|
|
||||||
if (__sync_fini)
|
// Finalize the synchronization subsystem
|
||||||
__sync_fini();
|
__sync_fini();
|
||||||
|
|
||||||
// Jump to the loader if it provided a callback
|
// Jump to the loader if it provided a callback
|
||||||
if (__system_retAddr)
|
if (__system_retAddr)
|
||||||
|
@ -8,12 +8,10 @@
|
|||||||
|
|
||||||
void (*__system_retAddr)(void);
|
void (*__system_retAddr)(void);
|
||||||
|
|
||||||
|
Result __sync_init(void);
|
||||||
void __system_initSyscalls(void);
|
void __system_initSyscalls(void);
|
||||||
void __system_allocateHeaps(void);
|
void __system_allocateHeaps(void);
|
||||||
void __system_initArgv(void);
|
void __system_initArgv(void);
|
||||||
void __appInit(void);
|
|
||||||
|
|
||||||
Result __sync_init(void);
|
|
||||||
|
|
||||||
void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
|
||||||
{
|
{
|
@ -1,7 +1,5 @@
|
|||||||
#include <3ds/asminc.h>
|
#include <3ds/asminc.h>
|
||||||
|
|
||||||
.arm
|
|
||||||
|
|
||||||
BEGIN_ASM_FUNC initSystem, weak
|
BEGIN_ASM_FUNC initSystem, weak
|
||||||
ldr r2, =saved_stack
|
ldr r2, =saved_stack
|
||||||
str sp, [r2]
|
str sp, [r2]
|
||||||
@ -19,7 +17,6 @@ BEGIN_ASM_FUNC initSystem, weak
|
|||||||
bics sp, sp, #7
|
bics sp, sp, #7
|
||||||
str sp, [r2]
|
str sp, [r2]
|
||||||
|
|
||||||
|
|
||||||
bl __appInit
|
bl __appInit
|
||||||
bl __libc_init_array
|
bl __libc_init_array
|
||||||
|
|
||||||
@ -37,16 +34,13 @@ BEGIN_ASM_FUNC __ctru_exit, weak
|
|||||||
b __libctru_exit
|
b __libctru_exit
|
||||||
END_ASM_FUNC
|
END_ASM_FUNC
|
||||||
|
|
||||||
.data
|
.section .data.__stacksize__, "aw"
|
||||||
.align 2
|
.align 2
|
||||||
__stacksize__:
|
__stacksize__:
|
||||||
.word 32 * 1024
|
.word 32 * 1024
|
||||||
.weak __stacksize__
|
.weak __stacksize__
|
||||||
|
|
||||||
|
.section .bss.saved_stack.42, "aw", %nobits
|
||||||
.bss
|
|
||||||
.align 2
|
.align 2
|
||||||
saved_stack:
|
saved_stack:
|
||||||
.space 8
|
.space 8
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ extern const u8 __tdata_lma[];
|
|||||||
extern const u8 __tdata_lma_end[];
|
extern const u8 __tdata_lma_end[];
|
||||||
extern u8 __tls_start[];
|
extern u8 __tls_start[];
|
||||||
|
|
||||||
static struct _reent* __ctru_get_reent()
|
static struct _reent* __libctru_get_reent()
|
||||||
{
|
{
|
||||||
ThreadVars* tv = getThreadVars();
|
ThreadVars* tv = getThreadVars();
|
||||||
if (tv->magic != THREADVARS_MAGIC)
|
if (tv->magic != THREADVARS_MAGIC)
|
||||||
@ -34,13 +34,12 @@ static int __libctru_nanosleep(const struct timespec *req, struct timespec *rem)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __system_initSyscalls(void)
|
||||||
void __attribute__((weak)) __system_initSyscalls(void)
|
|
||||||
{
|
{
|
||||||
// Register newlib syscalls
|
// Register newlib syscalls
|
||||||
__syscalls.exit = __ctru_exit;
|
__syscalls.exit = __ctru_exit;
|
||||||
__syscalls.gettod_r = __libctru_gtod;
|
__syscalls.gettod_r = __libctru_gtod;
|
||||||
__syscalls.getreent = __ctru_get_reent;
|
__syscalls.getreent = __libctru_get_reent;
|
||||||
__syscalls.nanosleep = __libctru_nanosleep;
|
__syscalls.nanosleep = __libctru_nanosleep;
|
||||||
|
|
||||||
// Register locking syscalls
|
// Register locking syscalls
|
||||||
|
Loading…
Reference in New Issue
Block a user