kernel: mailbox: remove legacy support
Change-Id: I218fbec7af4c4e69e4dc41c988f225b558600181 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
8b986d7697
commit
5e1f709b58
1 changed files with 0 additions and 92 deletions
|
@ -477,95 +477,3 @@ int k_mbox_get(struct k_mbox *mbox, struct k_mbox_msg *rx_msg, void *buffer,
|
|||
return result;
|
||||
}
|
||||
|
||||
/* Legacy APIs */
|
||||
#if defined(CONFIG_LEGACY_KERNEL)
|
||||
int task_mbox_put(kmbox_t mbox, kpriority_t prio, struct k_msg *msg,
|
||||
int32_t timeout)
|
||||
{
|
||||
struct k_mbox_msg *tx_msg = (struct k_mbox_msg *)msg;
|
||||
kpriority_t curr_prio;
|
||||
unsigned int key;
|
||||
int result;
|
||||
|
||||
/* handle old-style request to send an empty message */
|
||||
if (tx_msg->size == 0) {
|
||||
tx_msg->tx_block.pool_id = NULL;
|
||||
}
|
||||
|
||||
/* handle sending message of current thread priority */
|
||||
curr_prio = _current->base.prio;
|
||||
if (prio == curr_prio) {
|
||||
return _error_to_rc(k_mbox_put(mbox, tx_msg,
|
||||
_ticks_to_ms(timeout)));
|
||||
}
|
||||
|
||||
/* handle sending message of a different thread priority */
|
||||
key = irq_lock();
|
||||
_thread_priority_set(_current, prio);
|
||||
_reschedule_threads(key);
|
||||
|
||||
result = _error_to_rc(k_mbox_put(mbox, tx_msg, _ticks_to_ms(timeout)));
|
||||
|
||||
key = irq_lock();
|
||||
_thread_priority_set(_current, curr_prio);
|
||||
_reschedule_threads(key);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void task_mbox_block_put(kmbox_t mbox, kpriority_t prio, struct k_msg *msg,
|
||||
ksem_t sema)
|
||||
{
|
||||
struct k_mbox_msg *tx_msg = (struct k_mbox_msg *)msg;
|
||||
kpriority_t curr_prio;
|
||||
unsigned int key;
|
||||
|
||||
/* handle sending message of current thread priority */
|
||||
curr_prio = _current->base.prio;
|
||||
if (prio == curr_prio) {
|
||||
k_mbox_async_put(mbox, tx_msg, sema);
|
||||
return;
|
||||
}
|
||||
|
||||
/* handle sending message of a different thread priority */
|
||||
key = irq_lock();
|
||||
_thread_priority_set(_current, prio);
|
||||
_reschedule_threads(key);
|
||||
|
||||
k_mbox_async_put(mbox, tx_msg, sema);
|
||||
|
||||
key = irq_lock();
|
||||
_thread_priority_set(_current, curr_prio);
|
||||
_reschedule_threads(key);
|
||||
}
|
||||
|
||||
int task_mbox_get(kmbox_t mbox, struct k_msg *msg, int32_t timeout)
|
||||
{
|
||||
struct k_mbox_msg *rx_msg = (struct k_mbox_msg *)msg;
|
||||
|
||||
return _error_to_rc(k_mbox_get(mbox, rx_msg, rx_msg->_rx_data,
|
||||
_ticks_to_ms(timeout)));
|
||||
}
|
||||
|
||||
void task_mbox_data_get(struct k_msg *msg)
|
||||
{
|
||||
struct k_mbox_msg *rx_msg = (struct k_mbox_msg *)msg;
|
||||
|
||||
/* handle old-style request to discard message data */
|
||||
if (rx_msg->size == 0) {
|
||||
rx_msg->_rx_data = NULL;
|
||||
}
|
||||
|
||||
k_mbox_data_get(rx_msg, rx_msg->_rx_data);
|
||||
}
|
||||
|
||||
int task_mbox_data_block_get(struct k_msg *msg, struct k_block *block,
|
||||
kmemory_pool_t pool_id, int32_t timeout)
|
||||
{
|
||||
struct k_mbox_msg *rx_msg = (struct k_mbox_msg *)msg;
|
||||
|
||||
return _error_to_rc(k_mbox_data_block_get(rx_msg, pool_id, block,
|
||||
_ticks_to_ms(timeout)));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue