From 7a035ebcc006d0195c660b71cc92609c99d635ba Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 21 Aug 1998 16:54:17 +0000 Subject: Added system task attribute to allow one to create a task with "0" priority via the user api. --- c/src/exec/rtems/headers/attr.h | 3 +++ c/src/exec/rtems/include/rtems/rtems/attr.h | 3 +++ c/src/exec/rtems/inline/attr.inl | 17 +++++++++++++++++ c/src/exec/rtems/inline/rtems/rtems/attr.inl | 17 +++++++++++++++++ c/src/exec/rtems/macros/attr.inl | 9 +++++++++ c/src/exec/rtems/macros/rtems/rtems/attr.inl | 9 +++++++++ c/src/exec/rtems/src/tasks.c | 20 +++++++++++--------- cpukit/rtems/include/rtems/rtems/attr.h | 3 +++ cpukit/rtems/inline/rtems/rtems/attr.inl | 17 +++++++++++++++++ cpukit/rtems/macros/rtems/rtems/attr.inl | 9 +++++++++ cpukit/rtems/src/tasks.c | 20 +++++++++++--------- 11 files changed, 109 insertions(+), 18 deletions(-) diff --git a/c/src/exec/rtems/headers/attr.h b/c/src/exec/rtems/headers/attr.h index c5376540af..215b27f9a0 100644 --- a/c/src/exec/rtems/headers/attr.h +++ b/c/src/exec/rtems/headers/attr.h @@ -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 diff --git a/c/src/exec/rtems/include/rtems/rtems/attr.h b/c/src/exec/rtems/include/rtems/rtems/attr.h index c5376540af..215b27f9a0 100644 --- a/c/src/exec/rtems/include/rtems/rtems/attr.h +++ b/c/src/exec/rtems/include/rtems/rtems/attr.h @@ -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 diff --git a/c/src/exec/rtems/inline/attr.inl b/c/src/exec/rtems/inline/attr.inl index f8f890ae04..3cec1edd3b 100644 --- a/c/src/exec/rtems/inline/attr.inl +++ b/c/src/exec/rtems/inline/attr.inl @@ -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 */ diff --git a/c/src/exec/rtems/inline/rtems/rtems/attr.inl b/c/src/exec/rtems/inline/rtems/rtems/attr.inl index f8f890ae04..3cec1edd3b 100644 --- a/c/src/exec/rtems/inline/rtems/rtems/attr.inl +++ b/c/src/exec/rtems/inline/rtems/rtems/attr.inl @@ -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 */ diff --git a/c/src/exec/rtems/macros/attr.inl b/c/src/exec/rtems/macros/attr.inl index 844ac4f012..290e7f7870 100644 --- a/c/src/exec/rtems/macros/attr.inl +++ b/c/src/exec/rtems/macros/attr.inl @@ -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 */ diff --git a/c/src/exec/rtems/macros/rtems/rtems/attr.inl b/c/src/exec/rtems/macros/rtems/rtems/attr.inl index 844ac4f012..290e7f7870 100644 --- a/c/src/exec/rtems/macros/rtems/rtems/attr.inl +++ b/c/src/exec/rtems/macros/rtems/rtems/attr.inl @@ -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 */ diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c index 81955cd305..723a769836 100644 --- a/c/src/exec/rtems/src/tasks.c +++ b/c/src/exec/rtems/src/tasks.c @@ -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; diff --git a/cpukit/rtems/include/rtems/rtems/attr.h b/cpukit/rtems/include/rtems/rtems/attr.h index c5376540af..215b27f9a0 100644 --- a/cpukit/rtems/include/rtems/rtems/attr.h +++ b/cpukit/rtems/include/rtems/rtems/attr.h @@ -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 diff --git a/cpukit/rtems/inline/rtems/rtems/attr.inl b/cpukit/rtems/inline/rtems/rtems/attr.inl index f8f890ae04..3cec1edd3b 100644 --- a/cpukit/rtems/inline/rtems/rtems/attr.inl +++ b/cpukit/rtems/inline/rtems/rtems/attr.inl @@ -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 */ diff --git a/cpukit/rtems/macros/rtems/rtems/attr.inl b/cpukit/rtems/macros/rtems/rtems/attr.inl index 844ac4f012..290e7f7870 100644 --- a/cpukit/rtems/macros/rtems/rtems/attr.inl +++ b/cpukit/rtems/macros/rtems/rtems/attr.inl @@ -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 */ diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index 81955cd305..723a769836 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -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; -- cgit v1.2.3