Meco Man 4 年之前
父節點
當前提交
9f5878b2fb

+ 3 - 2
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

+ 4 - 6
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;

+ 5 - 3
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);
 }

+ 6 - 4
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)