source: rtems/cpukit/score/src/threadglobalconstruction.c @ 99fc1d1d

5
Last change on this file since 99fc1d1d was 9388390, checked in by Sebastian Huber <sebastian.huber@…>, on 05/13/16 at 05:04:43

score: Split _Thread_Restart()

Split _Thread_Restart() into _Thread_Restart_self() and
_Thread_Restart_other(). Move content of existing
_Thread_Restart_self() into new _Thread_Restart_self(). Avoid Giant
lock for thread restart. _Thread_Restart_self() is a no-return function
and used by _Thread_Global_construction().

Update #2555.
Update #2626.

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