RTEMS: cpukit/include/rtems/rtems/tasksimpl.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
tasksimpl.h
Go to the documentation of this file.
1
9/* COPYRIGHT (c) 1989-2014.
10 * On-Line Applications Research Corporation (OAR).
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17#ifndef _RTEMS_RTEMS_TASKSIMPL_H
18#define _RTEMS_RTEMS_TASKSIMPL_H
19
20#include <rtems/rtems/tasksdata.h>
21#include <rtems/score/objectimpl.h>
22#include <rtems/score/schedulerimpl.h>
23#include <rtems/score/threadimpl.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
43 void _RTEMS_tasks_Initialize_user_tasks( void );
44
45 RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate(void)
46{
47 _Objects_Allocator_lock();
48
49 _Thread_Kill_zombies();
50
51 return (Thread_Control *)
52 _Objects_Allocate_unprotected( &_RTEMS_tasks_Information.Objects );
53}
54
61 RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
62 Thread_Control *the_task
63)
64{
65 _Objects_Free(
66 _Objects_Get_information_id( the_task->Object.id ),
67 &the_task->Object
68 );
69}
70
85 RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_Priority_To_core(
86 const Scheduler_Control *scheduler,
87 rtems_task_priority priority,
88 bool *valid
89)
90{
91 *valid = ( priority <= scheduler->maximum_priority );
92
93 return _Scheduler_Map_priority( scheduler, (Priority_Control) priority );
94}
95
105 RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(
106 const Scheduler_Control *scheduler,
107 Priority_Control priority
108)
109{
110 return (rtems_task_priority)
111 _Scheduler_Unmap_priority( scheduler, priority );
112}
113
116#if defined(RTEMS_MULTIPROCESSING)
117#include <rtems/rtems/taskmp.h>
118#endif
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif
125/* end of include file */
_RTEMS_Priority_To_core
RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_Priority_To_core(const Scheduler_Control *scheduler, rtems_task_priority priority, bool *valid)
Converts the RTEMS API priority to the corresponding SuperCore priority and validates it.
Definition: tasksimpl.h:85
_RTEMS_tasks_Information
Thread_Information _RTEMS_tasks_Information
_RTEMS_tasks_Free
RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free(Thread_Control *the_task)
Frees a task control block.
Definition: tasksimpl.h:61
_RTEMS_Priority_From_core
RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(const Scheduler_Control *scheduler, Priority_Control priority)
Converts the SuperCore priority to the corresponding RTEMS API priority.
Definition: tasksimpl.h:105
_RTEMS_tasks_Initialize_user_tasks
void _RTEMS_tasks_Initialize_user_tasks(void)
RTEMS User Task Initialization.
rtems_task_priority
uint32_t rtems_task_priority
Definition: tasks.h:55
RTEMS_INLINE_ROUTINE
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
_Objects_Free
RTEMS_INLINE_ROUTINE void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectimpl.h:930
_Objects_Allocate_unprotected
RTEMS_INLINE_ROUTINE Objects_Control * _Objects_Allocate_unprotected(Objects_Information *information)
Allocates an object without locking the allocator mutex.
Definition: objectimpl.h:874
_Objects_Allocator_lock
RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock(void)
Locks the object allocator mutex.
Definition: objectimpl.h:831
_Objects_Get_information_id
Objects_Information * _Objects_Get_information_id(Objects_Id id)
Gets information of an object from an ID.
Definition: objectgetinfoid.c:24
Priority_Control
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:70
_Scheduler_Map_priority
RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Map_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Maps a thread priority from the user domain to the scheduler domain.
Definition: schedulerimpl.h:453
_Scheduler_Unmap_priority
RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Unmap_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Unmaps a thread priority from the scheduler domain to the user domain.
Definition: schedulerimpl.h:469
_Thread_Kill_zombies
void _Thread_Kill_zombies(void)
Kills all zombie threads in the system.
Definition: threadrestart.c:216
objectimpl.h
Inlined Routines in the Object Handler.
schedulerimpl.h
Inlined Routines Associated with the Manipulation of the Scheduler.
Objects_Control::id
Objects_Id id
Definition: objectdata.h:43
Thread_Information::Objects
Objects_Information Objects
The object information.
Definition: thread.h:1001
_Scheduler_Control
Scheduler control.
Definition: scheduler.h:269
_Scheduler_Control::maximum_priority
Priority_Control maximum_priority
The maximum priority value of this scheduler.
Definition: scheduler.h:286
_Thread_Control
Definition: thread.h:732
_Thread_Control::Object
Objects_Control Object
Definition: thread.h:734
taskmp.h
tasksdata.h
Classic Tasks Manager Data Structures.
threadimpl.h
Inlined Routines from the Thread Handler.