source: rtems/c/src/lib/libbsp/m68k/mvme162/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/*
2 *  This routine returns control to 162Bug.
3 *
4 *  COPYRIGHT (c) 1989-2010.
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 *  Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
12 *  EISCAT Scientific Association. M.Savitski
13 *
14 *  This material is a part of the MVME162 Board Support Package
15 *  for the RTEMS executive. Its licensing policies are those of the
16 *  RTEMS above.
17 */
18
19#include <bsp.h>
20#include <bsp/bootcard.h>
21#include <rtems/zilog/z8036.h>
22#include <page_table.h>
23
24extern void start( void  );
25
26void bsp_return_to_monitor_trap(void)
27{
28  page_table_teardown();
29
30  lcsr->intr_ena = 0;                    /* disable interrupts */
31  m68k_set_vbr(MOT_162BUG_VEC_ADDRESS);  /* restore 162Bug vectors */
32
33  __asm__ volatile( "trap   #15"  );    /* trap to 162Bug */
34  __asm__ volatile( ".short 0x63" );    /* return to 162Bug (.RETURN) */
35                                    /* restart program */
36  /*
37   *  This does not work on the 162....
38   */
39#if 0
40  {  register volatile void *start_addr;
41
42     start_addr = start;
43
44     __asm__ volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
45  }
46#endif
47}
48
49void bsp_fatal_extension(
50  rtems_fatal_source source,
51  bool is_internal,
52  rtems_fatal_code error
53)
54{
55   M68Kvec[ 45 ] = bsp_return_to_monitor_trap;   /* install handler */
56   __asm__ volatile( "trap #13" );  /* insures SUPV mode */
57}
58
59void bsp_cleanup(
60  uint32_t status
61)
62{
63  rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
64}
Note: See TracBrowser for help on using the repository browser.