Eliminate public use of non-public task structure

Revises several trivial task APIs to avoid exposure of task object
internal fields.

Change-Id: Iefa8028042dff1abd1f447eb1cc1ee49f0c2eda5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-05-15 14:38:08 -04:00 committed by Anas Nashif
commit 4a56570f9c
2 changed files with 67 additions and 7 deletions

View file

@ -42,6 +42,18 @@
#include <start_task_arch.h>
/*******************************************************************************
*
* task_id_get - get task identifer
*
* RETURNS: identifier for current task
*/
ktask_t task_id_get(void)
{
return _k_current_task->Ident;
}
/*******************************************************************************
*
* reset_state_bit - reset the specified task state bits
@ -434,6 +446,54 @@ void _task_group_ioctl(ktask_group_t group, /* task group */
KERNEL_ENTRY(&A);
}
/*******************************************************************************
*
* task_group_mask_get - get task groups for task
*
* RETURNS: task groups associated with current task
*/
kpriority_t task_group_mask_get(void)
{
return _k_current_task->Group;
}
/*******************************************************************************
*
* task_group_join - add task to task group(s)
*
* RETURNS: N/A
*/
void task_group_join(uint32_t groups)
{
_k_current_task->Group |= groups;
}
/*******************************************************************************
*
* task_group_leave - remove task from task group(s)
*
* RETURNS: N/A
*/
void task_group_leave(uint32_t groups)
{
_k_current_task->Group &= ~groups;
}
/*******************************************************************************
*
* task_priority_get - get task priority
*
* RETURNS: priority of current task
*/
kpriority_t task_priority_get(void)
{
return _k_current_task->Prio;
}
/*******************************************************************************
*
* _k_task_priority_set - handle task set priority request