score: Introduce Thread_Entry_information

This avoids potential dead code in _Thread_Handler().  It gets rid of
the dangerous function pointer casts.

Update #2514.
This commit is contained in:
Sebastian Huber
2016-01-07 09:55:45 +01:00
parent 3d1becf925
commit ccd54344d9
36 changed files with 234 additions and 198 deletions

View File

@@ -20,18 +20,15 @@
#include <bsp.h>
#include <rtems/score/thread.h>
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
rtems_task Init(
rtems_task_argument ignored
)
static void *Init( uintptr_t ignored )
{
/* initialize application */
/* Real application would call idle loop functionality */
/* but in this case, just return and fall into a fatal error */
return NULL;
}
/* configuration information */
@@ -98,7 +95,7 @@ rtems_task Init(
* In this application, the initialization task performs the system
* initialization and then transforms itself into the idle task.
*/
#define CONFIGURE_IDLE_TASK_BODY (Thread_Entry_numeric) Init
#define CONFIGURE_IDLE_TASK_BODY Init
#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
/*

View File

@@ -22,12 +22,7 @@
const char rtems_test_name[] = "SP 54";
/* forward declarations to avoid warnings */
rtems_task Init(rtems_task_argument argument);
rtems_task Init(
rtems_task_argument ignored
)
static void *Init( uintptr_t ignored )
{
rtems_status_code status;
rtems_task_priority pri;
@@ -68,7 +63,7 @@ rtems_task Init(
* In this application, the initialization task performs the system
* initialization and then transforms itself into the idle task.
*/
#define CONFIGURE_IDLE_TASK_BODY (Thread_Entry_numeric) Init
#define CONFIGURE_IDLE_TASK_BODY Init
#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
/*

View File

@@ -175,8 +175,8 @@ bool interrupt_critical_section_test_support_delay(void)
static bool is_idle( const Thread_Control *thread )
{
return thread->Start.entry_point
== (Thread_Entry) rtems_configuration_get_idle_task();
return thread->Start.Entry.Kinds.Idle.entry
== rtems_configuration_get_idle_task();
}
static void thread_switch( Thread_Control *executing, Thread_Control *heir )