RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
|
结构体 | |
struct | rt_mailbox |
类型定义 | |
typedef struct rt_mailbox * | rt_mailbox_t |
typedef struct rt_mailbox* rt_mailbox_t |
rt_err_t rt_mb_init | ( | rt_mailbox_t | mb, |
const char * | name, | ||
void * | msgpool, | ||
rt_size_t | size, | ||
rt_uint8_t | flag ) |
Initialize a static mailbox object.
mb | is a pointer to the mailbox to initialize. It is assumed that storage for the mailbox will be allocated in your application. |
name | is a pointer to the name that given to the mailbox. |
msgpool | the begin address of buffer to save received mail. |
size | is the maximum number of mails in the mailbox. For example, when the mailbox buffer capacity is N, size is N/4. |
flag | is the mailbox flag, which determines the queuing way of how multiple threads wait when the mailbox is not available. The mailbox flag can be ONE of the following values: RT_IPC_FLAG_PRIO The pending threads will queue in order of priority. RT_IPC_FLAG_FIFO The pending threads will queue in the first-in-first-out method (also known as first-come-first-served (FCFS) scheduling strategy). NOTE: RT_IPC_FLAG_FIFO is a non-real-time scheduling mode. It is strongly recommended to use RT_IPC_FLAG_PRIO to ensure the thread is real-time UNLESS your applications concern about the first-in-first-out principle, and you clearly understand that all threads involved in this mailbox will become non-real-time threads. |
引用了 _ipc_object_init(), rt_mailbox::entry, rt_object::flag, rt_mailbox::in_offset, rt_mailbox::msg_pool, rt_mailbox::out_offset, rt_ipc_object::parent, rt_mailbox::parent, RT_ASSERT, RT_IPC_FLAG_FIFO, RT_IPC_FLAG_PRIO, rt_list_init(), RT_NULL, RT_Object_Class_MailBox, rt_object_init(), rt_spin_lock_init(), rt_mailbox::size, rt_mailbox::spinlock , 以及 rt_mailbox::suspend_sender_thread.
RTM_EXPORT | ( | rt_mb_init | ) |
rt_err_t rt_mb_detach | ( | rt_mailbox_t | mb | ) |
This function will detach a static mailbox object.
mb | is a pointer to a mailbox object to be detached. |
引用了 rt_ipc_object::parent, rt_mailbox::parent, RT_ASSERT, RT_NULL, RT_Object_Class_MailBox, rt_object_detach(), rt_object_get_type(), rt_object_is_systemobject(), rt_spin_lock_irqsave(), rt_spin_unlock_irqrestore(), rt_susp_list_resume_all(), rt_mailbox::spinlock, rt_mailbox::suspend_sender_thread , 以及 rt_ipc_object::suspend_thread.
RTM_EXPORT | ( | rt_mb_detach | ) |
rt_mailbox_t rt_mb_create | ( | const char * | name, |
rt_size_t | size, | ||
rt_uint8_t | flag ) |
Creating a mailbox object.
name | is a pointer that given to the mailbox. |
size | is the maximum number of mails in the mailbox. For example, when mailbox buffer capacity is N, size is N/4. |
flag | is the mailbox flag, which determines the queuing way of how multiple threads wait when the mailbox is not available. The mailbox flag can be ONE of the following values: RT_IPC_FLAG_PRIO The pending threads will queue in order of priority. RT_IPC_FLAG_FIFO The pending threads will queue in the first-in-first-out method (also known as first-come-first-served (FCFS) scheduling strategy). NOTE: RT_IPC_FLAG_FIFO is a non-real-time scheduling mode. It is strongly recommended to use RT_IPC_FLAG_PRIO to ensure the thread is real-time UNLESS your applications concern about the first-in-first-out principle, and you clearly understand that all threads involved in this mailbox will become non-real-time threads. |
引用了 _ipc_object_init(), rt_mailbox::entry, rt_object::flag, rt_mailbox::in_offset, rt_mailbox::msg_pool, rt_mailbox::out_offset, rt_ipc_object::parent, rt_mailbox::parent, RT_ASSERT, RT_DEBUG_NOT_IN_INTERRUPT, RT_IPC_FLAG_FIFO, RT_IPC_FLAG_PRIO, RT_KERNEL_MALLOC, rt_list_init(), RT_NULL, rt_object_allocate(), RT_Object_Class_MailBox, rt_object_delete(), rt_spin_lock_init(), rt_mailbox::size, rt_mailbox::spinlock , 以及 rt_mailbox::suspend_sender_thread.
RTM_EXPORT | ( | rt_mb_create | ) |
rt_err_t rt_mb_delete | ( | rt_mailbox_t | mb | ) |
This function will delete a mailbox object and release the memory space.
mb | is a pointer to a mailbox object to be deleted. |
引用了 rt_mailbox::msg_pool, rt_ipc_object::parent, rt_mailbox::parent, RT_ASSERT, RT_DEBUG_NOT_IN_INTERRUPT, RT_FALSE, RT_KERNEL_FREE, RT_NULL, RT_Object_Class_MailBox, rt_object_delete(), rt_object_get_type(), rt_object_is_systemobject(), rt_spin_lock(), rt_spin_unlock(), rt_susp_list_resume_all(), rt_mailbox::spinlock, rt_mailbox::suspend_sender_thread , 以及 rt_ipc_object::suspend_thread.
RTM_EXPORT | ( | rt_mb_delete | ) |
rt_err_t rt_mb_send_wait | ( | rt_mailbox_t | mb, |
rt_ubase_t | value, | ||
rt_int32_t | timeout ) |
RTM_EXPORT | ( | rt_mb_send_wait | ) |
rt_err_t rt_mb_send_wait_interruptible | ( | rt_mailbox_t | mb, |
rt_ubase_t | value, | ||
rt_int32_t | timeout ) |
RTM_EXPORT | ( | rt_mb_send_wait_interruptible | ) |
rt_err_t rt_mb_send_wait_killable | ( | rt_mailbox_t | mb, |
rt_ubase_t | value, | ||
rt_int32_t | timeout ) |
RTM_EXPORT | ( | rt_mb_send_wait_killable | ) |
rt_err_t rt_mb_send | ( | rt_mailbox_t | mb, |
rt_ubase_t | value ) |
This function will send an mail to the mailbox object. If there is a thread suspended on the mailbox, the thread will be resumed.
mb | is a pointer to the mailbox object to be sent. |
value | is a value to the content of the mail you want to send. |
引用了 rt_mb_send_wait().
RTM_EXPORT | ( | rt_mb_send | ) |
rt_err_t rt_mb_send_interruptible | ( | rt_mailbox_t | mb, |
rt_ubase_t | value ) |
引用了 rt_mb_send_wait_interruptible().
RTM_EXPORT | ( | rt_mb_send_interruptible | ) |
rt_err_t rt_mb_send_killable | ( | rt_mailbox_t | mb, |
rt_ubase_t | value ) |
引用了 rt_mb_send_wait_killable().
RTM_EXPORT | ( | rt_mb_send_killable | ) |
rt_err_t rt_mb_urgent | ( | rt_mailbox_t | mb, |
rt_ubase_t | value ) |
This function will send an urgent mail to the mailbox object.
mb | is a pointer to the mailbox object to be sent. |
value | is the content of the mail you want to send. |
引用了 rt_mailbox::entry, rt_mailbox::msg_pool, rt_mailbox::out_offset, rt_ipc_object::parent, rt_mailbox::parent, RT_ASSERT, rt_list_isempty(), RT_NULL, RT_Object_Class_MailBox, rt_object_get_type(), RT_OBJECT_HOOK_CALL, rt_schedule(), rt_spin_lock_irqsave(), rt_spin_unlock_irqrestore(), rt_susp_list_dequeue(), rt_mailbox::size, rt_mailbox::spinlock , 以及 rt_ipc_object::suspend_thread.
RTM_EXPORT | ( | rt_mb_urgent | ) |
rt_err_t rt_mb_recv | ( | rt_mailbox_t | mb, |
rt_ubase_t * | value, | ||
rt_int32_t | timeout ) |
RTM_EXPORT | ( | rt_mb_recv | ) |
rt_err_t rt_mb_recv_interruptible | ( | rt_mailbox_t | mb, |
rt_ubase_t * | value, | ||
rt_int32_t | timeout ) |
RTM_EXPORT | ( | rt_mb_recv_interruptible | ) |
rt_err_t rt_mb_recv_killable | ( | rt_mailbox_t | mb, |
rt_ubase_t * | value, | ||
rt_int32_t | timeout ) |
RTM_EXPORT | ( | rt_mb_recv_killable | ) |
rt_err_t rt_mb_control | ( | rt_mailbox_t | mb, |
int | cmd, | ||
void * | arg ) |
This function will set some extra attributions of a mailbox object.
mb | is a pointer to a mailbox object. |
cmd | is a command used to configure some attributions of the mailbox. |
arg | is the argument of the function to execute the command. |
引用了 rt_mailbox::entry, rt_mailbox::in_offset, rt_mailbox::out_offset, rt_ipc_object::parent, rt_mailbox::parent, RT_ASSERT, RT_IPC_CMD_RESET, RT_NULL, RT_Object_Class_MailBox, rt_object_get_type(), rt_schedule(), rt_spin_lock_irqsave(), rt_spin_unlock_irqrestore(), rt_susp_list_resume_all(), RT_UNUSED, rt_mailbox::spinlock, rt_mailbox::suspend_sender_thread , 以及 rt_ipc_object::suspend_thread.
RTM_EXPORT | ( | rt_mb_control | ) |