source: rtems/c/src/lib/libbsp/m68k/mvme136/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.4 KB
Line 
1/*
2 *  This routine returns control to 135Bug.
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 <bsp.h>
13#include <bsp/bootcard.h>
14#include <rtems/zilog/z8036.h>
15
16extern void start( void  );
17
18void bsp_return_to_monitor_trap(void)
19{
20  register volatile void *start_addr;
21
22  m68k_set_vbr( 0 );                /* restore 135Bug vectors */
23  __asm__ volatile( "trap   #15"  );    /* trap to 135Bug */
24  __asm__ volatile( ".short 0x63" );    /* return to 135Bug (.RETURN) */
25                                    /* restart program */
26  start_addr = start;
27
28  __asm__ volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
29}
30
31#define TIMER   0xfffb0000
32
33void bsp_fatal_extension(
34  rtems_fatal_source source,
35  bool is_internal,
36  rtems_fatal_code error
37)
38{
39   Z8x36_WRITE( TIMER, MASTER_INTR,    0x62 );   /* redo timer */
40   Z8x36_WRITE( TIMER, CT1_MODE_SPEC,  0x00 );
41   Z8x36_WRITE( TIMER, MASTER_CFG,     0xf4 );
42   Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x00 );
43
44   M68Kvec[ 45 ] = bsp_return_to_monitor_trap;   /* install handler */
45   __asm__ volatile( "trap #13" );  /* insures SUPV mode */
46}
47
48void bsp_cleanup(
49  uint32_t status
50)
51{
52  rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
53}
Note: See TracBrowser for help on using the repository browser.