RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
|
宏定义 | |
#define | RT_HW_BACKTRACE_FRAME_GET_SELF(frame) |
#define | _MEM_INIT(...) |
#define | _MEM_MALLOC(...) |
#define | _MEM_REALLOC(...) |
#define | _MEM_FREE(...) |
#define | _MEM_INFO(...) |
#define | rt_container_of(ptr, type, member) |
#define | RT_LIST_OBJECT_INIT(object) |
#define | rt_list_entry(node, type, member) |
#define | rt_list_for_each(pos, head) |
#define | rt_list_for_each_safe(pos, n, head) |
#define | rt_list_for_each_entry(pos, head, member) |
#define | rt_list_for_each_entry_safe(pos, n, head, member) |
#define | rt_list_first_entry(ptr, type, member) |
#define | RT_SLIST_OBJECT_INIT(object) |
#define | rt_slist_entry(node, type, member) |
#define | rt_slist_for_each(pos, head) |
#define | rt_slist_for_each_entry(pos, head, member) |
#define | rt_slist_first_entry(ptr, type, member) |
#define | rt_slist_tail_entry(ptr, type, member) |
#define | rt_kprintf(...) |
#define | rt_kputs(str) |
#define | RT_ASSERT(EX) |
#define | RT_DEBUG_NOT_IN_INTERRUPT |
#define | RT_DEBUG_IN_THREAD_CONTEXT |
#define | RT_DEBUG_SCHEDULER_AVAILABLE(need_check) |
#define | rt_sched_thread_is_binding(thread) |
变量 | |
const rt_uint8_t | __lowest_bit_bitmap [] |
void | rt_realloc_set_entry_hook (void(*hook)(void **ptr, rt_size_t size)) |
void | rt_realloc_set_exit_hook (void(*hook)(void **ptr, rt_size_t size)) |
void | rt_free_sethook (void(*hook)(void **ptr)) |
other useful service in the kernel
#define RT_HW_BACKTRACE_FRAME_GET_SELF | ( | frame | ) |
在文件 kservice.c 第 101 行定义.
#define _MEM_INIT | ( | ... | ) |
在文件 kservice.c 第 760 行定义.
#define _MEM_MALLOC | ( | ... | ) |
在文件 kservice.c 第 761 行定义.
#define _MEM_REALLOC | ( | ... | ) |
在文件 kservice.c 第 762 行定义.
#define _MEM_FREE | ( | ... | ) |
在文件 kservice.c 第 763 行定义.
#define _MEM_INFO | ( | ... | ) |
在文件 kservice.c 第 764 行定义.
#define rt_container_of | ( | ptr, | |
type, | |||
member ) |
rt_container_of - return the start address of struct type, while ptr is the member of struct type.
在文件 rtservice.h 第 36 行定义.
#define RT_LIST_OBJECT_INIT | ( | object | ) |
#define rt_list_entry | ( | node, | |
type, | |||
member ) |
get the struct for this entry
node | the entry point |
type | the type of structure |
member | the name of list in structure |
在文件 rtservice.h 第 129 行定义.
#define rt_list_for_each | ( | pos, | |
head ) |
rt_list_for_each - iterate over a list
pos | the rt_list_t * to use as a loop cursor. |
head | the head for your list. |
在文件 rtservice.h 第 137 行定义.
#define rt_list_for_each_safe | ( | pos, | |
n, | |||
head ) |
rt_list_for_each_safe - iterate over a list safe against removal of list entry
pos | the rt_list_t * to use as a loop cursor. |
n | another rt_list_t * to use as temporary storage |
head | the head for your list. |
在文件 rtservice.h 第 146 行定义.
#define rt_list_for_each_entry | ( | pos, | |
head, | |||
member ) |
rt_list_for_each_entry - iterate over list of given type
pos | the type * to use as a loop cursor. |
head | the head for your list. |
member | the name of the list_struct within the struct. |
在文件 rtservice.h 第 156 行定义.
#define rt_list_for_each_entry_safe | ( | pos, | |
n, | |||
head, | |||
member ) |
rt_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
pos | the type * to use as a loop cursor. |
n | another type * to use as temporary storage |
head | the head for your list. |
member | the name of the list_struct within the struct. |
在文件 rtservice.h 第 168 行定义.
#define rt_list_first_entry | ( | ptr, | |
type, | |||
member ) |
rt_list_first_entry - get the first element from a list
ptr | the list head to take the element from. |
type | the type of the struct this is embedded in. |
member | the name of the list_struct within the struct. |
Note, that list is expected to be not empty.
在文件 rtservice.h 第 182 行定义.
#define RT_SLIST_OBJECT_INIT | ( | object | ) |
在文件 rtservice.h 第 185 行定义.
#define rt_slist_entry | ( | node, | |
type, | |||
member ) |
get the struct for this single list node
node | the entry point |
type | the type of structure |
member | the name of list in structure |
在文件 rtservice.h 第 282 行定义.
#define rt_slist_for_each | ( | pos, | |
head ) |
rt_slist_for_each - iterate over a single list
pos | the rt_slist_t * to use as a loop cursor. |
head | the head for your single list. |
在文件 rtservice.h 第 290 行定义.
#define rt_slist_for_each_entry | ( | pos, | |
head, | |||
member ) |
rt_slist_for_each_entry - iterate over single list of given type
pos | the type * to use as a loop cursor. |
head | the head for your single list. |
member | the name of the list_struct within the struct. |
在文件 rtservice.h 第 299 行定义.
#define rt_slist_first_entry | ( | ptr, | |
type, | |||
member ) |
rt_slist_first_entry - get the first element from a slist
ptr | the slist head to take the element from. |
type | the type of the struct this is embedded in. |
member | the name of the slist_struct within the struct. |
Note, that slist is expected to be not empty.
在文件 rtservice.h 第 312 行定义.
#define rt_slist_tail_entry | ( | ptr, | |
type, | |||
member ) |
rt_slist_tail_entry - get the tail element from a slist
ptr | the slist head to take the element from. |
type | the type of the struct this is embedded in. |
member | the name of the slist_struct within the struct. |
Note, that slist is expected to be not empty.
在文件 rtservice.h 第 323 行定义.
#define rt_kprintf | ( | ... | ) |
在文件 rtthread.h 第 771 行定义.
#define rt_kputs | ( | str | ) |
在文件 rtthread.h 第 772 行定义.
#define RT_ASSERT | ( | EX | ) |
在文件 rtthread.h 第 812 行定义.
#define RT_DEBUG_NOT_IN_INTERRUPT |
在文件 rtthread.h 第 866 行定义.
#define RT_DEBUG_IN_THREAD_CONTEXT |
在文件 rtthread.h 第 867 行定义.
#define RT_DEBUG_SCHEDULER_AVAILABLE | ( | need_check | ) |
在文件 rtthread.h 第 868 行定义.
#define rt_sched_thread_is_binding | ( | thread | ) |
在文件 rtthread.h 第 894 行定义.
rt_weak void rt_hw_us_delay | ( | rt_uint32_t | us | ) |
在文件 kservice.c 第 65 行定义.
引用了 LOG_W.
rt_weak void rt_hw_cpu_reset | ( | void | ) |
在文件 kservice.c 第 72 行定义.
引用了 LOG_W.
rt_weak void rt_hw_cpu_shutdown | ( | void | ) |
在文件 kservice.c 第 79 行定义.
引用了 LOG_I, LOG_W, RT_ASSERT , 以及 rt_hw_interrupt_disable().
rt_weak rt_err_t rt_hw_backtrace_frame_get | ( | rt_thread_t | thread, |
struct rt_hw_backtrace_frame * | frame ) |
Get the inner most frame of target thread
thread | the thread which frame belongs to |
frame | the specified frame to be unwound |
在文件 kservice.c 第 117 行定义.
rt_weak rt_err_t rt_hw_backtrace_frame_unwind | ( | rt_thread_t | thread, |
struct rt_hw_backtrace_frame * | frame ) |
Unwind the target frame
thread | the thread which frame belongs to |
frame | the specified frame to be unwound |
在文件 kservice.c 第 133 行定义.
rt_weak const char * rt_hw_cpu_arch | ( | void | ) |
在文件 kservice.c 第 142 行定义.
void rt_show_version | ( | void | ) |
This function will show the version of rt-thread rtos
在文件 kservice.c 第 150 行定义.
引用了 rt_kprintf, RT_VERSION_MAJOR, RT_VERSION_MINOR , 以及 RT_VERSION_PATCH.
RTM_EXPORT | ( | rt_show_version | ) |
rt_err_t rt_backtrace | ( | void | ) |
Print backtrace of current thread to system console device
在文件 kservice.c 第 394 行定义.
引用了 rt_hw_backtrace_frame::fp, rt_backtrace_frame(), RT_HW_BACKTRACE_FRAME_GET_SELF, rt_hw_backtrace_frame_unwind() , 以及 rt_thread_self().
rt_err_t rt_backtrace_frame | ( | rt_thread_t | thread, |
struct rt_hw_backtrace_frame * | frame ) |
Print backtrace from frame to system console device
thread | the thread which frame belongs to |
frame | where backtrace starts from |
在文件 kservice.c 第 416 行定义.
引用了 rt_hw_backtrace_frame::pc, rt_hw_backtrace_frame_unwind() , 以及 rt_kprintf.
rt_err_t rt_backtrace_formatted_print | ( | rt_ubase_t * | buffer, |
long | buflen ) |
Print backtrace from buffer to system console
buffer | where traced frames saved |
buflen | number of items in buffer |
在文件 kservice.c 第 442 行定义.
引用了 rt_kprintf.
rt_err_t rt_backtrace_to_buffer | ( | rt_thread_t | thread, |
struct rt_hw_backtrace_frame * | frame, | ||
long | skip, | ||
rt_ubase_t * | buffer, | ||
long | buflen ) |
Print backtrace from frame to the given buffer
thread | the thread which frame belongs to |
frame | where backtrace starts from. NULL if it's the current one |
skip | the number of frames to discarded counted from calling function. Noted that the inner most frame is always discarded and not counted, which is obviously reasonable since that's this function itself. |
buffer | where traced frames saved |
buflen | max number of items can be saved in buffer. If there are no more than buflen items to be saved, there will be a NULL after the last saved item in the buffer. |
在文件 kservice.c 第 470 行定义.
引用了 rt_hw_backtrace_frame::fp, rt_thread::parent, rt_hw_backtrace_frame::pc, RT_ASSERT, RT_HW_BACKTRACE_FRAME_GET_SELF, rt_hw_backtrace_frame_unwind(), RT_NULL, RT_Object_Class_Thread , 以及 rt_object_get_type().
rt_err_t rt_backtrace_thread | ( | rt_thread_t | thread | ) |
Print backtrace of a thread to system console device
thread | which call stack is traced |
在文件 kservice.c 第 519 行定义.
引用了 rt_backtrace_frame() , 以及 rt_hw_backtrace_frame_get().
void rt_realloc_set_entry_hook | ( | void(* | hook )(void **ptr, rt_size_t size) | ) |
This function will set a hook function, which will be invoked when a memory block is allocated from heap memory.
hook | the hook function. |
在文件 kservice.c 第 613 行定义.
void rt_realloc_set_exit_hook | ( | void(* | hook )(void **ptr, rt_size_t size) | ) |
This function will set a hook function, which will be invoked when a memory block is allocated from heap memory.
hook | the hook function. |
在文件 kservice.c 第 624 行定义.
void rt_free_sethook | ( | void(* | hook )(void **ptr) | ) |
This function will set a hook function, which will be invoked when a memory block is released to heap memory.
hook | the hook function |
在文件 kservice.c 第 635 行定义.
rt_inline void _heap_lock_init | ( | void | ) |
在文件 kservice.c 第 650 行定义.
引用了 RT_IPC_FLAG_PRIO, rt_mutex_init() , 以及 rt_spin_lock_init().
rt_inline rt_base_t _heap_lock | ( | void | ) |
在文件 kservice.c 第 659 行定义.
引用了 rt_enter_critical(), rt_mutex_take(), rt_spin_lock_irqsave(), rt_thread_self() , 以及 RT_WAITING_FOREVER.
rt_inline void _heap_unlock | ( | rt_base_t | level | ) |
在文件 kservice.c 第 674 行定义.
引用了 RT_ASSERT, rt_exit_critical(), rt_mutex_release(), rt_spin_unlock_irqrestore() , 以及 rt_thread_self().
void rt_system_heap_init_generic | ( | void * | begin_addr, |
void * | end_addr ) |
This function will do the generic system heap initialization.
begin_addr | the beginning address of system page. |
end_addr | the end address of system page. |
在文件 kservice.c 第 774 行定义.
引用了 _heap_lock_init(), _MEM_INIT, RT_ALIGN, RT_ALIGN_DOWN , 以及 RT_ASSERT.
rt_weak void rt_system_heap_init | ( | void * | begin_addr, |
void * | end_addr ) |
This function will init system heap. User can override this API to complete other works, like heap sanitizer initialization.
begin_addr | the beginning address of system page. |
end_addr | the end address of system page. |
在文件 kservice.c 第 795 行定义.
引用了 rt_system_heap_init_generic().
rt_weak void * rt_malloc | ( | rt_size_t | size | ) |
Allocate a block of memory with a minimum of 'size' bytes.
size | is the minimum size of the requested block in bytes. |
在文件 kservice.c 第 807 行定义.
引用了 _heap_lock(), _heap_unlock(), _MEM_MALLOC , 以及 RT_OBJECT_HOOK_CALL.
RTM_EXPORT | ( | rt_malloc | ) |
rt_weak void * rt_realloc | ( | void * | ptr, |
rt_size_t | newsize ) |
This function will change the size of previously allocated memory block.
ptr | is the pointer to memory allocated by rt_malloc. |
newsize | is the required new size. |
在文件 kservice.c 第 833 行定义.
引用了 _heap_lock(), _heap_unlock(), _MEM_REALLOC , 以及 RT_OBJECT_HOOK_CALL.
RTM_EXPORT | ( | rt_realloc | ) |
This function will contiguously allocate enough space for count objects that are size bytes of memory each and returns a pointer to the allocated memory.
count | is the number of objects to allocate. |
size | is the size of one object to allocate. |
在文件 kservice.c 第 865 行定义.
引用了 rt_malloc().
RTM_EXPORT | ( | rt_calloc | ) |
rt_weak void rt_free | ( | void * | ptr | ) |
This function will release the previously allocated memory block by rt_malloc. The released memory block is taken back to system heap.
ptr | the address of memory which will be released. |
在文件 kservice.c 第 886 行定义.
引用了 _heap_lock(), _heap_unlock(), _MEM_FREE, RT_NULL , 以及 RT_OBJECT_HOOK_CALL.
This function will caculate the total memory, the used memory, and the max used memory.
total | is a pointer to get the total size of the memory. |
used | is a pointer to get the size of memory used. |
max_used | is a pointer to get the maximum memory used. |
在文件 kservice.c 第 912 行定义.
引用了 _heap_lock(), _heap_unlock() , 以及 _MEM_INFO.
RTM_EXPORT | ( | rt_memory_info | ) |
This function allocates a memory block, which address is aligned to the specified alignment size.
size | is the allocated memory block size. |
align | is the alignment size. |
在文件 kservice.c 第 965 行定义.
引用了 rt_malloc() , 以及 RT_NULL.
RTM_EXPORT | ( | rt_malloc_align | ) |
rt_weak void rt_free_align | ( | void * | ptr | ) |
This function release the memory block, which is allocated by rt_malloc_align function and address is aligned.
ptr | is the memory block pointer. |
在文件 kservice.c 第 1011 行定义.
RTM_EXPORT | ( | rt_free_align | ) |
int __rt_ffs | ( | int | value | ) |
This function finds the first bit set (beginning with the least significant bit) in value and return the index of that bit.
Bits are numbered starting at 1 (the least significant bit). A return value of zero from any of these functions means that the argument was zero.
value | is the value to find the first bit set in. |
在文件 kservice.c 第 1083 行定义.
引用了 __lowest_bit_bitmap.
rt_inline void rt_list_init | ( | rt_list_t * | l | ) |
initialize a list
l | list to be initialized |
在文件 rtservice.h 第 50 行定义.
引用了 rt_list_node::next , 以及 rt_list_node::prev.
insert a node after a list
l | list to insert it |
n | new node to be inserted |
在文件 rtservice.h 第 61 行定义.
引用了 rt_list_node::next , 以及 rt_list_node::prev.
insert a node before a list
n | new node to be inserted |
l | list to insert it |
在文件 rtservice.h 第 76 行定义.
引用了 rt_list_node::next , 以及 rt_list_node::prev.
rt_inline void rt_list_remove | ( | rt_list_t * | n | ) |
remove node from list.
n | the node to remove from the list. |
在文件 rtservice.h 第 89 行定义.
引用了 rt_list_node::next , 以及 rt_list_node::prev.
rt_inline int rt_list_isempty | ( | const rt_list_t * | l | ) |
tests whether a list is empty
l | the list to test. |
在文件 rtservice.h 第 101 行定义.
引用了 rt_list_node::next.
rt_inline unsigned int rt_list_len | ( | const rt_list_t * | l | ) |
get the list length
l | the list to get. |
在文件 rtservice.h 第 110 行定义.
引用了 rt_list_node::next.
rt_inline void rt_slist_init | ( | rt_slist_t * | l | ) |
initialize a single list
l | the single list to be initialized |
在文件 rtservice.h 第 192 行定义.
引用了 rt_slist_node::next , 以及 RT_NULL.
rt_inline void rt_slist_append | ( | rt_slist_t * | l, |
rt_slist_t * | n ) |
在文件 rtservice.h 第 197 行定义.
引用了 rt_slist_node::next , 以及 RT_NULL.
rt_inline void rt_slist_insert | ( | rt_slist_t * | l, |
rt_slist_t * | n ) |
在文件 rtservice.h 第 209 行定义.
引用了 rt_slist_node::next.
rt_inline unsigned int rt_slist_len | ( | const rt_slist_t * | l | ) |
在文件 rtservice.h 第 215 行定义.
引用了 rt_slist_node::next , 以及 RT_NULL.
rt_inline rt_slist_t * rt_slist_pop | ( | rt_slist_t * | l | ) |
在文件 rtservice.h 第 228 行定义.
引用了 rt_slist_node::next.
rt_inline rt_slist_t * rt_slist_remove | ( | rt_slist_t * | l, |
rt_slist_t * | n ) |
在文件 rtservice.h 第 242 行定义.
引用了 rt_slist_node::next.
rt_inline rt_slist_t * rt_slist_first | ( | rt_slist_t * | l | ) |
rt_inline rt_slist_t * rt_slist_tail | ( | rt_slist_t * | l | ) |
在文件 rtservice.h 第 259 行定义.
引用了 rt_slist_node::next.
rt_inline rt_slist_t * rt_slist_next | ( | rt_slist_t * | n | ) |
rt_inline int rt_slist_isempty | ( | rt_slist_t * | l | ) |
在文件 rtservice.h 第 271 行定义.
引用了 rt_slist_node::next , 以及 RT_NULL.
unsigned long __rt_ffsl | ( | unsigned long | value | ) |
unsigned long __rt_clz | ( | unsigned long | value | ) |
rt_inline rt_bool_t rt_in_thread_context | ( | void | ) |
在文件 rtthread.h 第 871 行定义.
引用了 rt_interrupt_get_nest(), RT_NULL , 以及 rt_thread_self().
rt_inline rt_bool_t rt_scheduler_is_available | ( | void | ) |
在文件 rtthread.h 第 877 行定义.
引用了 rt_critical_level() , 以及 rt_in_thread_context().
const rt_uint8_t __lowest_bit_bitmap[] |
在文件 kservice.c 第 1051 行定义.