source: rtems/c/src/lib/libbsp/m68k/mrm332/misc/interr.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.7 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
12#include <rtems/system.h>
13#include <rtems/score/interr.h>
14#include <rtems/score/sysstate.h>
15#include <rtems/score/userext.h>
16
17/*PAGE
18 *
19 *  _Internal_error_Occurred
20 *
21 *  This routine will invoke the fatal error handler supplied by the user
22 *  followed by the the default one provided by the executive.  The default
23 *  error handler assumes no hardware is present to help inform the user
24 *  of the problem.  Halt stores the error code in a known register,
25 *  disables interrupts, and halts the CPU.  If the CPU does not have a
26 *  halt instruction, it will loop to itself.
27 *
28 *  Input parameters:
29 *    the_source  - what subsystem the error originated in
30 *    is_internal - if the error was internally generated
31 *    the_error   - fatal error status code
32 *
33 *  Output parameters:
34 *    As much information as possible is stored in a CPU dependent fashion.
35 *    See the CPU dependent code for more information.
36 *
37 *  NOTE: The the_error is not necessarily a directive status code.
38 */
39
40/*
41 * Ugly hack.... _CPU_Fatal_halt() disonnects the bdm. Without this
42 * change, the_error is only known only to the cpu :).
43 *
44 * From "bsp.h" which is not yet available in the arch tree during
45 * this phase of install. jsg
46 */
47void outbyte(char);
48
49#define RAW_PUTS(str) \
50  { register char *ptr = str; \
51    while (*ptr) outbyte(*ptr++); \
52  }
53
54#define RAW_PUTI(n) { \
55    register int i, j; \
56    \
57    RAW_PUTS("0x"); \
58    for (i=28;i>=0;i -= 4) { \
59      j = (n>>i) & 0xf; \
60      outbyte( (j>9 ? j-10+'a' : j+'0') ); \
61    } \
62  }
63
64void volatile _Internal_error_Occurred(
65  Internal_errors_Source  the_source,
66  bool                    is_internal,
67  uint32_t                the_error
68)
69{
70
71  _Internal_errors_What_happened.the_source  = the_source;
72  _Internal_errors_What_happened.is_internal = is_internal;
73  _Internal_errors_What_happened.the_error   = the_error;
74
75  _User_extensions_Fatal( the_source, is_internal, the_error );
76
77  _System_state_Set( SYSTEM_STATE_FAILED );
78
79  /* try to print error message to outbyte */
80  RAW_PUTS("\r\nRTEMS: A fatal error has occured.\r\n");
81  RAW_PUTS("RTEMS:    fatal error ");
82  RAW_PUTI( the_error );
83  RAW_PUTS(" (");
84  outbyte( (char)((the_error>>24) & 0xff) );
85  outbyte( (char)((the_error>>16) & 0xff) );
86  outbyte( (char)((the_error>>8) & 0xff) );
87  outbyte( (char)(the_error & 0xff) );
88  RAW_PUTS(").\r\n");
89
90  /* configure peripherals for a safe exit */
91  bsp_cleanup(1);
92
93  _CPU_Fatal_halt( the_error );
94
95  /* will not return from this routine */
96}
Note: See TracBrowser for help on using the repository browser.