source: rtems/c/src/lib/libbsp/powerpc/virtex4/startup/bspclean.c @ a052181

4.115
Last change on this file since a052181 was a052181, checked in by Sebastian Huber <sebastian.huber@…>, on 11/14/12 at 08:59:10

score: Add RTEMS_FATAL_SOURCE_EXIT

Include <bsp/default-initial-extension.h> in all BSPs. Call
rtems_fatal() with RTEMS_FATAL_SOURCE_EXIT as source and the exit()
status code as fatal code in every bsp_cleanup(). Move previous
bsp_cleanup() code into bsp_fatal_extension().

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*  bsp_cleanup()
2 *
3 *  This routine normally is part of start.s and usually returns
4 *  control to a monitor.
5 *
6 *  INPUT:  NONE
7 *
8 *  OUTPUT: NONE
9 *
10 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
11 *
12 *  COPYRIGHT (c) 1995 by i-cubed ltd.
13 *
14 *  To anyone who acknowledges that this file is provided "AS IS"
15 *  without any express or implied warranty:
16 *      permission to use, copy, modify, and distribute this file
17 *      for any purpose is hereby granted without fee, provided that
18 *      the above copyright notice and this notice appears in all
19 *      copies, and that the name of i-cubed limited not be used in
20 *      advertising or publicity pertaining to distribution of the
21 *      software without specific, written prior permission.
22 *      i-cubed limited makes no representations about the suitability
23 *      of this software for any purpose.
24 *
25 *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspclean.c:
26 *
27 *  COPYRIGHT (c) 1989-1999.
28 *  On-Line Applications Research Corporation (OAR).
29 *
30 *  The license and distribution terms for this file may be
31 *  found in the file LICENSE in this distribution or at
32 *  http://www.rtems.com/license/LICENSE.
33 */
34
35#include <bsp.h>
36#include <bsp/bootcard.h>
37
38static void _noopfun(void) {}
39
40void app_bsp_cleanup(void)
41__attribute__(( weak, alias("_noopfun") ));
42
43void bsp_fatal_extension(
44  rtems_fatal_source source,
45  bool is_internal,
46  rtems_fatal_code error
47)
48{
49  if ( source == RTEMS_FATAL_SOURCE_EXIT ) {
50    app_bsp_cleanup();
51  }
52
53  /* All done.  Hang out. */
54  BSP_ask_for_reset();
55}
56
57void bsp_cleanup( uint32_t status )
58{
59  rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
60}
Note: See TracBrowser for help on using the repository browser.