From b168032339212e994e0b511d8d5d0dd11d8374db Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Mon, 1 Jun 2020 15:03:36 +0100 Subject: [PATCH] fix exit sequence --- libraries/wutcrt/crt0_rpl.s | 1 - libraries/wutcrt/crt0_rpx.s | 1 - libraries/wutnewlib/wut_newlib.c | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/wutcrt/crt0_rpl.s b/libraries/wutcrt/crt0_rpl.s index 1ed6d91..3512c14 100644 --- a/libraries/wutcrt/crt0_rpl.s +++ b/libraries/wutcrt/crt0_rpl.s @@ -28,7 +28,6 @@ unload: lwz 3, 0xC(1) lwz 4, 0x10(1) bl rpl_entry - bl __fini_wut addi 1, 1, 0x14 b exit diff --git a/libraries/wutcrt/crt0_rpx.s b/libraries/wutcrt/crt0_rpx.s index c80c669..4de8989 100644 --- a/libraries/wutcrt/crt0_rpx.s +++ b/libraries/wutcrt/crt0_rpx.s @@ -14,6 +14,5 @@ __rpx_start: lwz 3, 0xC(1) lwz 4, 0x10(1) bl main - bl __fini_wut addi 1, 1, 0x14 b exit diff --git a/libraries/wutnewlib/wut_newlib.c b/libraries/wutnewlib/wut_newlib.c index d4b61ac..c19362d 100644 --- a/libraries/wutnewlib/wut_newlib.c +++ b/libraries/wutnewlib/wut_newlib.c @@ -2,6 +2,7 @@ #include void(*__wut_exit)(int rc); +extern void __fini_wut(void); int __syscall_lock_init(int *lock, int recursive) { return __wut_lock_init(lock,recursive); @@ -19,7 +20,8 @@ int __syscall_lock_acquire(int *lock) { return __wut_lock_acquire(lock); } -void __syscall_exit(int rc) { +void __syscall_exit(int rc) { + __fini_wut(); __wut_exit(rc); }