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

5
Last change on this file since fce900b5 was d5e073c, checked in by Sebastian Huber <sebastian.huber@…>, on 11/11/16 at 13:37:51

score: Allow interrupts during thread dispatch

Use a processor-specific interrupt frame during context switches in case
the executing thread is longer executes on the processor and the heir
thread is about to start execution. During this period we must not use
a thread stack for interrupt processing.

Update #2809.

  • Property mode set to 100644
File size: 1.1 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#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
29  if ( the_thread->Start.fp_context ) {
30    the_thread->fp_context = the_thread->Start.fp_context;
31    _Context_Initialize_fp( &the_thread->fp_context );
32  }
33#endif
34
35  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
36  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
37  the_thread->budget_callout   = the_thread->Start.budget_callout;
38
39  _Context_Initialize(
40    &the_thread->Registers,
41    the_thread->Start.Initial_stack.area,
42    the_thread->Start.Initial_stack.size,
43    the_thread->Start.isr_level,
44    _Thread_Handler,
45    the_thread->is_fp,
46    the_thread->Start.tls_area
47  );
48}
Note: See TracBrowser for help on using the repository browser.