forked from Imagelibrary/rtems
@@ -35,6 +35,15 @@
|
||||
#include <rtems/posix/config.h>
|
||||
#include <rtems/rtems/config.h>
|
||||
|
||||
static void *_POSIX_Global_construction( void *arg )
|
||||
{
|
||||
Thread_Entry entry_point = (Thread_Entry) Configuration_POSIX_API
|
||||
.User_initialization_threads_table[ 0 ].thread_entry;
|
||||
|
||||
(void) arg;
|
||||
_Thread_Global_construction( entry_point );
|
||||
}
|
||||
|
||||
void _POSIX_Threads_Initialize_user_threads_body(void)
|
||||
{
|
||||
int eno;
|
||||
@@ -84,7 +93,7 @@ void _POSIX_Threads_Initialize_user_threads_body(void)
|
||||
|
||||
if ( register_global_construction ) {
|
||||
register_global_construction = false;
|
||||
thread_entry = (void *(*)(void *)) _Thread_Global_construction;
|
||||
thread_entry = _POSIX_Global_construction;
|
||||
}
|
||||
|
||||
eno = pthread_create(
|
||||
|
||||
@@ -31,6 +31,15 @@
|
||||
#include <rtems/score/wkspace.h>
|
||||
#include <rtems/score/apiext.h>
|
||||
|
||||
static void _RTEMS_Global_construction( rtems_task_argument arg )
|
||||
{
|
||||
Thread_Entry entry_point = (Thread_Entry)
|
||||
Configuration_RTEMS_API.User_initialization_tasks_table[ 0 ].entry_point;
|
||||
|
||||
(void) arg;
|
||||
_Thread_Global_construction( entry_point );
|
||||
}
|
||||
|
||||
/*
|
||||
* _RTEMS_tasks_Initialize_user_tasks_body
|
||||
*
|
||||
@@ -92,7 +101,7 @@ void _RTEMS_tasks_Initialize_user_tasks_body( void )
|
||||
|
||||
if ( register_global_construction ) {
|
||||
register_global_construction = false;
|
||||
entry_point = (rtems_task_entry) _Thread_Global_construction;
|
||||
entry_point = _RTEMS_Global_construction;
|
||||
}
|
||||
|
||||
return_value = rtems_task_start(
|
||||
|
||||
@@ -325,7 +325,7 @@ void _Thread_Handler( void );
|
||||
* the first POSIX initialization thread in case no RTEMS initialization tasks
|
||||
* are present.
|
||||
*/
|
||||
void *_Thread_Global_construction( void );
|
||||
void _Thread_Global_construction( Thread_Entry entry_point ) RTEMS_NO_RETURN;
|
||||
|
||||
/**
|
||||
* @brief Ended the delay of a thread.
|
||||
|
||||
@@ -44,10 +44,9 @@
|
||||
#define EXECUTE_GLOBAL_CONSTRUCTORS
|
||||
#endif
|
||||
|
||||
void *_Thread_Global_construction( void )
|
||||
void _Thread_Global_construction( Thread_Entry entry_point )
|
||||
{
|
||||
Thread_Control *executing;
|
||||
Thread_Entry entry_point;
|
||||
|
||||
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
|
||||
/*
|
||||
@@ -58,19 +57,6 @@ void *_Thread_Global_construction( void )
|
||||
INIT_NAME();
|
||||
#endif
|
||||
|
||||
#if defined(RTEMS_POSIX_API)
|
||||
if ( Configuration_RTEMS_API.number_of_initialization_tasks > 0 ) {
|
||||
#endif
|
||||
entry_point = (Thread_Entry)
|
||||
Configuration_RTEMS_API.User_initialization_tasks_table[ 0 ].entry_point;
|
||||
#if defined(RTEMS_POSIX_API)
|
||||
} else {
|
||||
entry_point = (Thread_Entry)
|
||||
Configuration_POSIX_API
|
||||
.User_initialization_threads_table[ 0 ].thread_entry;
|
||||
}
|
||||
#endif
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
executing = _Thread_Executing;
|
||||
@@ -86,6 +72,4 @@ void *_Thread_Global_construction( void )
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
_Assert_Not_reached();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user