diff options
| author | Bernard Xiong <[email protected]> | 2018-06-10 17:56:02 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-06-10 17:56:02 +0800 |
| commit | 682da9b249c8019c078b277742a6b36deb2af7b2 (patch) | |
| tree | 1ee2065957a903072ea6b983c80bedfbe84b0e8d /components/libc | |
| parent | c83c8d84625b3095182690544cddeae637711e39 (diff) | |
[Kernel] Remove object container in module feature.
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/newlib/syscalls.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index 514dda147f..822182ba93 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -7,7 +7,7 @@ #include <dfs_posix.h> #endif -#ifdef RT_USING_PTHREADS +#ifdef RT_USING_PTHREADS #include <pthread.h> #endif @@ -126,7 +126,7 @@ _open_r(struct _reent *ptr, const char *file, int flags, int mode) #endif } -_ssize_t +_ssize_t _read_r(struct _reent *ptr, int fd, void *buf, size_t nbytes) { #ifndef RT_USING_DFS @@ -372,7 +372,7 @@ void *_calloc_r (struct _reent *ptr, size_t size, size_t len) return result; } -void +void _free_r (struct _reent *ptr, void *addr) { rt_free (addr); @@ -387,43 +387,20 @@ _exit (int status) module = rt_module_self(); if (module != RT_NULL) { - struct rt_list_node *list; - struct rt_object *object; - - rt_enter_critical(); - - /* delete all threads in the module */ - list = &module->module_object[RT_Object_Class_Thread].object_list; - while (list->next != list) - { - object = rt_list_entry(list->next, struct rt_object, list); - if (rt_object_is_systemobject(object) == RT_TRUE) - { - /* detach static object */ - rt_thread_detach((rt_thread_t)object); - } - else - { - /* delete dynamic object */ - rt_thread_delete((rt_thread_t)object); - } - } - /* delete main thread */ - rt_thread_delete(module->module_thread); - rt_exit_critical(); + rt_thread_suspend(rt_thread_self()); /* re-schedule */ rt_schedule(); } #endif - + rt_kprintf("thread:%s exit with %d\n", rt_thread_self()->name, status); RT_ASSERT(0); while (1); } -void +void _system(const char *s) { /* not support this call */ |
