source: rtems/cpukit/score/src/threadloadenv.c @ 1506658c

5
Last change on this file since 1506658c was 335e5ca, checked in by Sebastian Huber <sebastian.huber@…>, on 06/02/15 at 19:43:54

score: Add Thread_Control::is_fp

Store the floating-point unit property in the thread control block
regardless of the CPU_HARDWARE_FP and CPU_SOFTWARE_FP settings. Make
sure the floating-point unit is only enabled for the corresponding
multilibs. This helps targets which have a volatile only floating point
context like SPARC for example.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @brief Initializes Enviroment for A Thread
5 *
6 * @ingroup ScoreThread
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-1999.
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
24void _Thread_Load_environment(
25  Thread_Control *the_thread
26)
27{
28  uint32_t isr_level;
29
30#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
31  if ( the_thread->Start.fp_context ) {
32    the_thread->fp_context = the_thread->Start.fp_context;
33    _Context_Initialize_fp( &the_thread->fp_context );
34  }
35#endif
36
37  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
38  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
39  the_thread->budget_callout   = the_thread->Start.budget_callout;
40
41#if defined( RTEMS_SMP )
42  /*
43   * On SMP we have to start the threads with interrupts disabled, see also
44   * _Thread_Handler() and _Thread_Dispatch().  In _Thread_Handler() the
45   * _ISR_Set_level() is used to set the desired interrupt state of the thread.
46   */
47  isr_level = CPU_MODES_INTERRUPT_MASK;
48#else
49  isr_level = the_thread->Start.isr_level;
50#endif
51
52  _Context_Initialize(
53    &the_thread->Registers,
54    the_thread->Start.Initial_stack.area,
55    the_thread->Start.Initial_stack.size,
56    isr_level,
57    _Thread_Handler,
58    the_thread->is_fp,
59    the_thread->Start.tls_area
60  );
61
62}
Note: See TracBrowser for help on using the repository browser.