source: rtems/cpukit/score/src/interr.c @ 749d64a

4.104.115
Last change on this file since 749d64a was 749d64a, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 12, 2009 at 12:16:23 PM

Reflect having introduced Internal_errors_t.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  Internal Error Handler
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/score/interr.h>
20#include <rtems/score/sysstate.h>
21#include <rtems/score/userext.h>
22
23/*PAGE
24 *
25 *  _Internal_error_Occurred
26 *
27 *  This routine will invoke the fatal error handler supplied by the user
28 *  followed by the the default one provided by the executive.  The default
29 *  error handler assumes no hardware is present to help inform the user
30 *  of the problem.  Halt stores the error code in a known register,
31 *  disables interrupts, and halts the CPU.  If the CPU does not have a
32 *  halt instruction, it will loop to itself.
33 *
34 *  Input parameters:
35 *    the_source  - what subsystem the error originated in
36 *    is_internal - if the error was internally generated
37 *    the_error   - fatal error status code
38 *
39 *  Output parameters:
40 *    As much information as possible is stored in a CPU dependent fashion.
41 *    See the CPU dependent code for more information.
42 *
43 *  NOTE: The the_error is not necessarily a directive status code.
44 */
45
46void _Internal_error_Occurred(
47  Internal_errors_Source  the_source,
48  bool                    is_internal,
49  Internal_errors_t       the_error
50)
51{
52
53  _Internal_errors_What_happened.the_source  = the_source;
54  _Internal_errors_What_happened.is_internal = is_internal;
55  _Internal_errors_What_happened.the_error   = the_error;
56
57  _User_extensions_Fatal( the_source, is_internal, the_error );
58
59  _System_state_Set( SYSTEM_STATE_FAILED );
60
61  _CPU_Fatal_halt( the_error );
62
63  /* will not return from this routine */
64  while (true);
65}
Note: See TracBrowser for help on using the repository browser.