blob: 7ce1862d8cd59963834cca492bc96c9efb272873 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/**
* @file
*
* @brief Thread Global Construction
*
* @ingroup ScoreThread
*/
/*
* COPYRIGHT (c) 1989-2012.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/score/threadimpl.h>
/*
* Conditional magic to determine what style of C++ constructor
* initialization this target and compiler version uses.
*/
#if defined(__USE_INIT_FINI__)
#if defined(__ARM_EABI__)
#define INIT_NAME __libc_init_array
#else
#define INIT_NAME _init
#endif
extern void INIT_NAME(void);
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
#if defined(__USE__MAIN__)
extern void __main(void);
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Global_construction(
Thread_Control *executing,
const Thread_Entry_information *entry
)
{
ISR_lock_Context lock_context;
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
/*
* _init could be a weak symbol and we SHOULD test it but it isn't
* in any configuration I know of and it generates a warning on every
* RTEMS target configuration. --joel (12 May 2007)
*/
INIT_NAME();
#endif
_ISR_lock_ISR_disable( &lock_context );
_Thread_Restart_self( _Thread_Executing, entry, &lock_context );
}
|