15#ifndef SYSTEM_THREAD_STACK_SIZE
16#define SYSTEM_THREAD_STACK_SIZE IDLE_THREAD_STACK_SIZE
20#if defined(RT_USING_SMP) || defined(RT_USING_SMART)
39#if defined(RT_USING_SMP) || defined(RT_USING_SMART)
78 struct rt_dlmodule *module =
RT_NULL;
88 module = (struct rt_dlmodule *)thread->parent.module_id;
91 dlmodule_destroy(module);
95#ifdef RT_USING_SIGNALS
96 rt_thread_free_sig(thread);
104 if (object_is_systemobject ==
RT_TRUE)
117#ifdef RT_USING_MEM_PROTECTION
118 if (thread->mem_regions !=
RT_NULL)
124 if (object_is_systemobject ==
RT_FALSE)
127#ifdef RT_USING_HW_STACK_GUARD
139#if defined(RT_USING_SMP) || defined(RT_USING_SMART)
140static void rt_thread_system_entry(
void *parameter)
149 rt_kprintf(
"failed to sem_take() error %d\n", ret);
163#if defined(RT_USING_SMP) || defined(RT_USING_SMART)
169 rt_thread_system_entry,
172 sizeof(rt_system_stack),
173 RT_THREAD_PRIORITY_MAX - 2,
#define SYSTEM_THREAD_STACK_SIZE
void rt_thread_defunct_enqueue(rt_thread_t thread)
Enqueue a thread to defunct queue.
void rt_defunct_execute(void)
This function will perform system background job when system idle.
rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
This function will disable the local interrupt and then lock the spinlock, will lock the thread sched...
rt_thread_t rt_thread_defunct_dequeue(void)
Dequeue a thread from defunct queue.
void rt_thread_defunct_init(void)
#define RT_WAITING_FOREVER
void rt_spin_lock_init(struct rt_spinlock *lock)
Initialize a static spinlock object.
void rt_spin_unlock_irqrestore(struct rt_spinlock *lock, rt_base_t level)
This function will unlock the spinlock and then restore current cpu interrupt status,...
void rt_object_delete(rt_object_t object)
This function will delete an object and release object memory.
rt_bool_t rt_object_is_systemobject(rt_object_t object)
This function will judge the object is system object or not.
struct rt_object * rt_object_t
void rt_object_detach(rt_object_t object)
This function will detach a static object from object system, and the memory of static object is not ...
rt_inline void rt_list_remove(rt_list_t *n)
remove node from list.
rt_inline int rt_list_isempty(const rt_list_t *l)
tests whether a list is empty
#define RT_LIST_OBJECT_INIT(object)
initialize a list object
rt_inline void rt_list_insert_after(rt_list_t *l, rt_list_t *n)
insert a node after a list
rt_err_t rt_thread_startup(rt_thread_t thread)
This function will start a thread and put it to system ready queue.
rt_err_t rt_thread_init(struct rt_thread *thread, const char *name, void(*entry)(void *parameter), void *parameter, void *stack_start, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick)
This function will initialize a thread. It's used to initialize a static thread object.
struct rt_thread * rt_thread_t
rt_err_t rt_sem_init(rt_sem_t sem, const char *name, rt_uint32_t value, rt_uint8_t flag)
This function will initialize a static semaphore object.
rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time)
rt_err_t rt_sem_release(rt_sem_t sem)
This function will release a semaphore. If there is thread suspended on the semaphore,...
rt_align(RT_ALIGN_SIZE)
This function sets a hook function to idle thread loop. When the system performs idle loop,...
#define RT_KERNEL_FREE(ptr)
#define RT_THREAD_LIST_NODE(thread)
#define RT_THREAD_LIST_NODE_ENTRY(node)
struct rt_list_node rt_list_t
struct rt_list_node * next
rt_thread_cleanup_t cleanup