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 | |
---|
16 | extern void start( void ); |
---|
17 | |
---|
18 | void 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 | |
---|
33 | void 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 | |
---|
48 | void bsp_cleanup( |
---|
49 | uint32_t status |
---|
50 | ) |
---|
51 | { |
---|
52 | rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); |
---|
53 | } |
---|