1 | /* |
---|
2 | * This routine returns control to 162Bug. |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * All rights assigned to U.S. Government, 1994. |
---|
7 | * |
---|
8 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
9 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
10 | * notice must appear in all copies of this file and its derivatives. |
---|
11 | * |
---|
12 | * |
---|
13 | * Modifications of respective RTEMS file: COPYRIGHT (c) 1994. |
---|
14 | * EISCAT Scientific Association. M.Savitski |
---|
15 | * |
---|
16 | * This material is a part of the MVME162 Board Support Package |
---|
17 | * for the RTEMS executive. Its licensing policies are those of the |
---|
18 | * RTEMS above. |
---|
19 | * |
---|
20 | * $Id$ |
---|
21 | */ |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | #include <bsp.h> |
---|
25 | #include <z8036.h> |
---|
26 | #include <page_table.h> |
---|
27 | |
---|
28 | void bsp_return_to_monitor_trap() |
---|
29 | { |
---|
30 | extern void start( void ); |
---|
31 | |
---|
32 | page_table_teardown(); |
---|
33 | |
---|
34 | lcsr->intr_ena = 0; /* disable interrupts */ |
---|
35 | m68k_set_vbr(0xFFE00000); /* restore 162Bug vectors */ |
---|
36 | asm volatile( "trap #15" ); /* trap to 162Bug */ |
---|
37 | asm volatile( ".short 0x63" ); /* return to 162Bug (.RETURN) */ |
---|
38 | /* restart program */ |
---|
39 | /* |
---|
40 | * This does not work on the 162.... |
---|
41 | */ |
---|
42 | #if 0 |
---|
43 | { register volatile void *start_addr; |
---|
44 | |
---|
45 | start_addr = start; |
---|
46 | |
---|
47 | asm volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) ); |
---|
48 | } |
---|
49 | #endif |
---|
50 | } |
---|
51 | |
---|
52 | void bsp_cleanup( void ) |
---|
53 | { |
---|
54 | M68Kvec[ 45 ] = bsp_return_to_monitor_trap; /* install handler */ |
---|
55 | asm volatile( "trap #13" ); /* insures SUPV mode */ |
---|
56 | } |
---|