source: rtems/cpukit/score/src/interr.c @ 7336be9d

4.115
Last change on this file since 7336be9d was 7336be9d, checked in by Sebastian Huber <sebastian.huber@…>, on 02/18/14 at 12:40:39

score: SMP initialization and shutdown changes

Rename _SMP_Request_other_cores_to_perform_first_context_switch() into
_SMP_Request_start_multitasking() since this requests now a multitasking
start on all configured and available processors. The name corresponds
_Thread_Start_multitasking() and
_SMP_Start_multitasking_on_secondary_processor() actions issued in
response to this request. Move in source file to right place.

Rename PER_CPU_STATE_READY_TO_BEGIN_MULTITASKING into
PER_CPU_STATE_READY_TO_START_MULTITASKING.

Rename PER_CPU_STATE_BEGIN_MULTITASKING into
PER_CPU_STATE_REQUEST_START_MULTITASKING.

Rename _SMP_Request_other_cores_to_shutdown() into
_SMP_Request_shutdown().

Add a per-CPU state lock to protect all changes. This was necessary to
offer a controlled shutdown of the system (atomic read/writes alone are
not sufficient for this kind of synchronization).

Add documentation for Per_CPU_State.

Delete debug output.

New tests smptests/smpfatal01 and smptests/smpfatal02.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief Initiates system termination
5 * @ingroup ScoreIntErr
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-1999.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/interr.h>
22#include <rtems/score/isrlevel.h>
23#include <rtems/score/smpimpl.h>
24#include <rtems/score/sysstate.h>
25#include <rtems/score/userextimpl.h>
26
27System_state_Codes _System_state_Current;
28
29Internal_errors_Information _Internal_errors_What_happened;
30
31void _Terminate(
32  Internal_errors_Source  the_source,
33  bool                    is_internal,
34  Internal_errors_t       the_error
35)
36{
37  ISR_Level level;
38
39  _ISR_Disable_without_giant( level );
40  (void) level;
41
42  _SMP_Request_shutdown();
43
44  _User_extensions_Fatal( the_source, is_internal, the_error );
45
46  _Internal_errors_What_happened.the_source  = the_source;
47  _Internal_errors_What_happened.is_internal = is_internal;
48  _Internal_errors_What_happened.the_error   = the_error;
49
50  _System_state_Set( SYSTEM_STATE_TERMINATED );
51
52  _CPU_Fatal_halt( the_error );
53
54  /* will not return from this routine */
55  while (true);
56}
Note: See TracBrowser for help on using the repository browser.