summaryrefslogtreecommitdiff
path: root/components/libc/compilers/newlib
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-02-17 00:02:28 +0800
committerMeco Man <[email protected]>2021-02-17 00:02:28 +0800
commite927a53b41fa58573e14eccac37374d686ad3cf7 (patch)
tree7e18aa21c63b86a7b7d18cdfb55349817f86d388 /components/libc/compilers/newlib
parente19873db6d6947f02e0b093251adf3c73daabdd8 (diff)
精简exit abort system函数
Diffstat (limited to 'components/libc/compilers/newlib')
-rw-r--r--components/libc/compilers/newlib/syscalls.c42
1 files changed, 6 insertions, 36 deletions
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c
index cf98e0c3ec..7fe02eb0a0 100644
--- a/components/libc/compilers/newlib/syscalls.c
+++ b/components/libc/compilers/newlib/syscalls.c
@@ -286,30 +286,15 @@ _free_r (struct _reent *ptr, void *addr)
void
exit (int status)
{
- rt_thread_t self = rt_thread_self();
-
-#ifdef RT_USING_MODULE
- if (dlmodule_self())
- {
- dlmodule_exit(status);
- }
-#endif
-
- if (self != RT_NULL)
- {
- rt_kprintf("thread:%-8.*s exit:%d!\n", RT_NAME_MAX, self->name, status);
- rt_thread_suspend(self);
- rt_schedule();
- }
-
- while(1); /* noreturn */
+ extern rt_inline void __exit__(int status);
+ __exit__(status);
}
void
_system(const char *s)
{
- /* not support this call */
- return;
+ extern rt_inline int __system__(const char *string);
+ __system__(string);
}
void __libc_init_array(void)
@@ -319,23 +304,8 @@ void __libc_init_array(void)
void abort(void)
{
- rt_thread_t self = rt_thread_self();
-
-#ifdef RT_USING_MODULE
- if (dlmodule_self())
- {
- dlmodule_exit(-1);
- }
-#endif
-
- if (self != RT_NULL)
- {
- rt_kprintf("thread:%-8.*s abort!\n", RT_NAME_MAX, self->name);
- rt_thread_suspend(self);
- rt_schedule();
- }
-
- while(1); /* noreturn */
+ extern rt_inline void __abort__(void);
+ __abort__();
}
uid_t getuid(void)