source: rtems/c/src/lib/libbsp/m68k/mvme136/startup/bspclean.c @ 5e858ba7

4.11
Last change on this file since 5e858ba7 was 5e858ba7, checked in by Ralf Corsepius <ralf.corsepius@…>, on Feb 11, 2011 at 12:34:23 PM

2011-02-11 Ralf Corsépius <ralf.corsepius@…>

  • include/bsp.h, shmsupp/lock.c, startup/bspclean.c: Use "asm" instead of "asm" for improved c99-compliance.
  • Property mode set to 100644
File size: 1.2 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 *  $Id$
12 */
13
14#include <rtems.h>
15#include <bsp.h>
16#include <rtems/clockdrv.h>
17#include <rtems/zilog/z8036.h>
18
19extern void start( void  );
20
21void bsp_return_to_monitor_trap(void)
22{
23  register volatile void *start_addr;
24
25  m68k_set_vbr( 0 );                /* restore 135Bug vectors */
26  __asm__ volatile( "trap   #15"  );    /* trap to 135Bug */
27  __asm__ volatile( ".short 0x63" );    /* return to 135Bug (.RETURN) */
28                                    /* restart program */
29  start_addr = start;
30
31  __asm__ volatile ( "jmp %0@" : "=a" (start_addr) : "0" (start_addr) );
32}
33
34#define TIMER   0xfffb0000
35
36void bsp_cleanup( void )
37{
38   Z8x36_WRITE( TIMER, MASTER_INTR,    0x62 );   /* redo timer */
39   Z8x36_WRITE( TIMER, CT1_MODE_SPEC,  0x00 );
40   Z8x36_WRITE( TIMER, MASTER_CFG,     0xf4 );
41   Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0x00 );
42
43   M68Kvec[ 45 ] = bsp_return_to_monitor_trap;   /* install handler */
44   __asm__ volatile( "trap #13" );  /* insures SUPV mode */
45}
Note: See TracBrowser for help on using the repository browser.