source: rtems-schedsim/schedsim/rtems/interr.c @ e5e757b

Last change on this file since e5e757b was a2aad55, checked in by Joel Sherrill <joel.sherrill@…>, on May 1, 2013 at 12:41:56 AM

Remove CVS $

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  BASED UPON SOURCE IN RTEMS, MODIFIED FOR SIMULATOR
3 *
4 *  Internal Error Handler
5 *
6 *  COPYRIGHT (c) 1989-2013.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
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#include <stdlib.h>
24#include <stdio.h>
25
26/*PAGE
27 *
28 *  _Internal_error_Occurred
29 *
30 *  This routine will invoke the fatal error handler supplied by the user
31 *  followed by the the default one provided by the executive.  The default
32 *  error handler assumes no hardware is present to help inform the user
33 *  of the problem.  Halt stores the error code in a known register,
34 *  disables interrupts, and halts the CPU.  If the CPU does not have a
35 *  halt instruction, it will loop to itself.
36 *
37 *  Input parameters:
38 *    the_source  - what subsystem the error originated in
39 *    is_internal - if the error was internally generated
40 *    the_error   - fatal error status code
41 *
42 *  Output parameters:
43 *    As much information as possible is stored in a CPU dependent fashion.
44 *    See the CPU dependent code for more information.
45 *
46 *  NOTE: The the_error is not necessarily a directive status code.
47 */
48
49void _Internal_error_Occurred(
50  Internal_errors_Source  the_source,
51  bool                    is_internal,
52  Internal_errors_t       the_error
53)
54{
55
56  _Internal_errors_What_happened.the_source  = the_source;
57  _Internal_errors_What_happened.is_internal = is_internal;
58  _Internal_errors_What_happened.the_error   = the_error;
59
60  // _User_extensions_Fatal( the_source, is_internal, the_error );
61
62  _System_state_Set( SYSTEM_STATE_FAILED );
63
64  fprintf( stderr, "FATAL ERROR!!\n" );
65  exit( -1 );
66
67  /* will not return from this routine */
68  while (true);
69}
Note: See TracBrowser for help on using the repository browser.