diff options
Diffstat (limited to 'cpukit/itron/macros/rtems/itron/task.inl')
-rw-r--r-- | cpukit/itron/macros/rtems/itron/task.inl | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/cpukit/itron/macros/rtems/itron/task.inl b/cpukit/itron/macros/rtems/itron/task.inl new file mode 100644 index 0000000000..807a02fc6f --- /dev/null +++ b/cpukit/itron/macros/rtems/itron/task.inl @@ -0,0 +1,102 @@ +/* + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#ifndef __ITRON_TASK_inl_ +#define __ITRON_TASK_inl_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * _ITRON_Task_Allocate + */ + +#define _ITRON_Task_Allocate( _tskid ) \ + (Thread_Control *)_ITRON_Objects_Allocate_by_index( \ + &_ITRON_Task_Information, \ + (_tskid), \ + sizeof(Thread_Control) \ + ) + +/* + * _ITRON_Task_Clarify_allocation_id_error + */ + +#define _ITRON_Task_Clarify_allocation_id_error( _id ) \ + _ITRON_Objects_Clarify_allocation_id_error( \ + &_ITRON_Task_Information, (_id) ) + +/* + * _ITRON_Task_Clarify_get_id_error + */ + +#define _ITRON_Task_Clarify_get_id_error( _id ) \ + _ITRON_Objects_Clarify_get_id_error( &_ITRON_Task_Information, (_id) ) + +/* + * _ITRON_Task_Free + */ + +#define _ITRON_Task_Free( _the_task ) \ + _ITRON_Objects_Free( &_ITRON_Task_Information, &(_the_task)->Object ) + +/*PAGE + * + * _ITRON_Task_Get + */ + +/* XXX fix me */ +static Thread_Control *_ITRON_Task_Get ( + ID id, + Objects_Locations *location +) +{ + if ( id == 0 ) { + _Thread_Disable_dispatch(); + *location = OBJECTS_LOCAL; + return _Thread_Executing; + } + + return (Thread_Control *) + _ITRON_Objects_Get( &_ITRON_Task_Information, id, location ); +} + +/*PAGE + * + * _ITRON_Task_Is_null + */ + +#define _ITRON_Task_Is_null( _the_task ) \ + ( (_the_task) == NULL ) + +/*PAGE + * + * _ITRON_tasks_Priority_to_Core + */ + +#define _ITRON_Task_Priority_to_Core( _ITRON_priority ) \ + ((Priority_Control) (_ITRON_priority)) + +/*PAGE + * + * _ITRON_tasks_Core_to_Priority + */ + +#define _ITRON_Task_Core_to_Priority( _core_priority ) \ + ((PRI) (_core_priority)) + +#ifdef __cplusplus +} +#endif + +#endif +/* end of include file */ |