[ac7d5ef0] | 1 | /* tasks.inl |
---|
| 2 | * |
---|
| 3 | * This file contains the static inline implementation of all inlined |
---|
| 4 | * routines in the with RTEMS Tasks Manager. |
---|
| 5 | * |
---|
| 6 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * All rights assigned to U.S. Government, 1994. |
---|
| 9 | * |
---|
| 10 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 11 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 12 | * notice must appear in all copies of this file and its derivatives. |
---|
| 13 | * |
---|
| 14 | * $Id$ |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef __RTEMS_TASKS_inl |
---|
| 18 | #define __RTEMS_TASKS_inl |
---|
| 19 | |
---|
| 20 | /*PAGE |
---|
| 21 | * |
---|
| 22 | * _RTEMS_tasks_Allocate |
---|
| 23 | * |
---|
[1a8fde6c] | 24 | * DESCRIPTION: |
---|
| 25 | * |
---|
| 26 | * This function allocates a task control block from |
---|
| 27 | * the inactive chain of free task control blocks. |
---|
[ac7d5ef0] | 28 | */ |
---|
| 29 | |
---|
[503dc058] | 30 | RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void ) |
---|
[ac7d5ef0] | 31 | { |
---|
[5250ff39] | 32 | return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information ); |
---|
[ac7d5ef0] | 33 | } |
---|
| 34 | |
---|
| 35 | /*PAGE |
---|
| 36 | * |
---|
| 37 | * _RTEMS_tasks_Free |
---|
| 38 | * |
---|
[1a8fde6c] | 39 | * DESCRIPTION: |
---|
| 40 | * |
---|
| 41 | * This routine frees a task control block to the |
---|
| 42 | * inactive chain of free task control blocks. |
---|
[ac7d5ef0] | 43 | */ |
---|
| 44 | |
---|
[503dc058] | 45 | RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free ( |
---|
[ac7d5ef0] | 46 | Thread_Control *the_task |
---|
| 47 | ) |
---|
| 48 | { |
---|
[7f6a24ab] | 49 | _Objects_Free( |
---|
| 50 | _Objects_Get_information( the_task->Object.id ), |
---|
| 51 | &the_task->Object |
---|
| 52 | ); |
---|
[ac7d5ef0] | 53 | } |
---|
| 54 | |
---|
| 55 | /*PAGE |
---|
| 56 | * |
---|
[3a4ae6c] | 57 | * _RTEMS_tasks_Priority_to_Core |
---|
[1a8fde6c] | 58 | * |
---|
| 59 | * DESCRIPTION: |
---|
| 60 | * |
---|
| 61 | * This function converts an RTEMS API priority into a core priority. |
---|
[ac7d5ef0] | 62 | */ |
---|
[3a4ae6c] | 63 | |
---|
[503dc058] | 64 | RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_tasks_Priority_to_Core( |
---|
[3a4ae6c] | 65 | rtems_task_priority priority |
---|
[ac7d5ef0] | 66 | ) |
---|
| 67 | { |
---|
[3a4ae6c] | 68 | return (Priority_Control) priority; |
---|
[ac7d5ef0] | 69 | } |
---|
| 70 | |
---|
[7f6a24ab] | 71 | /*PAGE |
---|
| 72 | * |
---|
[3a4ae6c] | 73 | * _RTEMS_tasks_Priority_is_valid |
---|
| 74 | * |
---|
[1a8fde6c] | 75 | * DESCRIPTION: |
---|
| 76 | * |
---|
| 77 | * This function returns TRUE if the_priority is a valid user task priority |
---|
| 78 | * and FALSE otherwise. |
---|
[7f6a24ab] | 79 | */ |
---|
| 80 | |
---|
[503dc058] | 81 | RTEMS_INLINE_ROUTINE boolean _RTEMS_tasks_Priority_is_valid ( |
---|
[3a4ae6c] | 82 | rtems_task_priority the_priority |
---|
[7f6a24ab] | 83 | ) |
---|
| 84 | { |
---|
[3a4ae6c] | 85 | return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && |
---|
| 86 | ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); |
---|
[7f6a24ab] | 87 | } |
---|
| 88 | |
---|
[ac7d5ef0] | 89 | #endif |
---|
| 90 | /* end of include file */ |
---|