Added system task attribute to allow one to create a task with "0" priority

via the user api.
This commit is contained in:
Joel Sherrill
1998-08-21 16:54:17 +00:00
parent eb562f2c86
commit 7a035ebcc0
11 changed files with 109 additions and 18 deletions

View File

@@ -47,6 +47,9 @@ typedef unsigned32 rtems_attribute;
#define RTEMS_NO_PRIORITY_CEILING 0x00000000
#define RTEMS_PRIORITY_CEILING 0x00000040
#define RTEMS_APPLICATION_TASK 0x00000000
#define RTEMS_SYSTEM_TASK 0x00000080
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#define ATTRIBUTES_NOT_SUPPORTED 0
#else

View File

@@ -47,6 +47,9 @@ typedef unsigned32 rtems_attribute;
#define RTEMS_NO_PRIORITY_CEILING 0x00000000
#define RTEMS_PRIORITY_CEILING 0x00000040
#define RTEMS_APPLICATION_TASK 0x00000000
#define RTEMS_SYSTEM_TASK 0x00000080
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#define ATTRIBUTES_NOT_SUPPORTED 0
#else

View File

@@ -155,5 +155,22 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
return ( attribute_set & RTEMS_PRIORITY_CEILING );
}
/*PAGE
*
* _Attributes_Is_system_task
*
* DESCRIPTION:
*
* This function returns TRUE if the system task attribute
* is enabled in the attribute_set and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY_CEILING );
}
#endif
/* end of include file */

View File

@@ -155,5 +155,22 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_priority_ceiling(
return ( attribute_set & RTEMS_PRIORITY_CEILING );
}
/*PAGE
*
* _Attributes_Is_system_task
*
* DESCRIPTION:
*
* This function returns TRUE if the system task attribute
* is enabled in the attribute_set and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE boolean _Attributes_Is_system_task(
rtems_attribute attribute_set
)
{
return ( attribute_set & RTEMS_PRIORITY_CEILING );
}
#endif
/* end of include file */

View File

@@ -87,5 +87,14 @@
#define _Attributes_Is_priority_ceiling( _attribute_set ) \
( (_attribute_set) & RTEMS_PRIORITY_CEILING )
/*PAGE
*
* _Attributes_Is_system_task
*
*/
#define _Attributes_Is_system_task( _attribute_set ) \
( (_attribute_set) & RTEMS_SYSTEM_TASK )
#endif
/* end of include file */

View File

@@ -87,5 +87,14 @@
#define _Attributes_Is_priority_ceiling( _attribute_set ) \
( (_attribute_set) & RTEMS_PRIORITY_CEILING )
/*PAGE
*
* _Attributes_Is_system_task
*
*/
#define _Attributes_Is_system_task( _attribute_set ) \
( (_attribute_set) & RTEMS_SYSTEM_TASK )
#endif
/* end of include file */

View File

@@ -268,15 +268,6 @@ rtems_status_code rtems_task_create(
return RTEMS_INVALID_SIZE;
#endif
/*
* Validate the RTEMS API priority and convert it to the core priority range.
*/
if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) )
return RTEMS_INVALID_PRIORITY;
core_priority = _RTEMS_tasks_Priority_to_Core( initial_priority );
/*
* Fix the attribute set to match the attributes which
* this processor (1) requires and (2) is able to support.
@@ -295,6 +286,17 @@ rtems_status_code rtems_task_create(
else
is_fp = FALSE;
/*
* Validate the RTEMS API priority and convert it to the core priority range.
*/
if ( !_Attributes_Is_system_task( the_attribute_set ) ) {
if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) )
return RTEMS_INVALID_PRIORITY;
}
core_priority = _RTEMS_tasks_Priority_to_Core( initial_priority );
if ( _Attributes_Is_global( the_attribute_set ) ) {
is_global = TRUE;