From 9f5878b2fbdf90afb9c92dc40d99b79905b2b158 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 17 Feb 2021 00:18:49 +0800 Subject: [PATCH] update --- components/libc/compilers/armlibc/syscalls.c | 5 +++-- components/libc/compilers/common/stdlib.c | 10 ++++------ components/libc/compilers/dlib/syscalls.c | 8 +++++--- components/libc/compilers/newlib/syscalls.c | 10 ++++++---- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 43b655e1a6..eb31a9118a 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -258,8 +258,9 @@ void _ttywrch(int ch) RT_WEAK void _sys_exit(int return_code) { - extern rt_inline void __exit__(int status); + extern void __exit__(int status); __exit__(return_code); + while(1); } /** @@ -305,7 +306,7 @@ int remove(const char *filename) #else int system(const char *string) { - extern rt_inline int __system__(const char *string); + extern int __system__(const char *string); return __system__(string); } #endif diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c index 01f18aca5f..022342aea9 100644 --- a/components/libc/compilers/common/stdlib.c +++ b/components/libc/compilers/common/stdlib.c @@ -12,7 +12,7 @@ #define ABORT_STATUS 2 -rt_inline void __exit__(int status) +void __exit__(int status) { rt_thread_t self = rt_thread_self(); @@ -27,7 +27,7 @@ rt_inline void __exit__(int status) { if(status == ABORT_STATUS) /* abort() */ { - rt_kprintf("thread:%s abort!\n", RT_NAME_MAX, self->name, status); + rt_kprintf("thread:%s abort!\n", RT_NAME_MAX, self->name); } else /* exit() */ { @@ -36,16 +36,14 @@ rt_inline void __exit__(int status) rt_thread_suspend(self); rt_schedule(); } - - while(1); /* noreturn */ } -rt_inline void __abort__(void) +void __abort__(void) { __exit__(ABORT_STATUS); } -rt_inline int __system__(const char *string) +int __system__(const char *string) { /* TODO */ return 0; diff --git a/components/libc/compilers/dlib/syscalls.c b/components/libc/compilers/dlib/syscalls.c index 6f16da2fcb..a185b0104b 100644 --- a/components/libc/compilers/dlib/syscalls.c +++ b/components/libc/compilers/dlib/syscalls.c @@ -11,12 +11,14 @@ void exit (int status) { - extern rt_inline void __exit__(int status); - __exit__(return_code); + extern void __exit__(int status); + __exit__(status); + while(1); } void abort(void) { - extern rt_inline void __abort__(void); + extern void __abort__(void); __abort__(); + while(1); } diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index 7fe02eb0a0..6f833f05e4 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -286,15 +286,16 @@ _free_r (struct _reent *ptr, void *addr) void exit (int status) { - extern rt_inline void __exit__(int status); + extern void __exit__(int status); __exit__(status); + while(1); } void _system(const char *s) { - extern rt_inline int __system__(const char *string); - __system__(string); + extern int __system__(const char *string); + __system__(s); } void __libc_init_array(void) @@ -304,8 +305,9 @@ void __libc_init_array(void) void abort(void) { - extern rt_inline void __abort__(void); + extern void __abort__(void); __abort__(); + while(1); } uid_t getuid(void) -- GitLab