OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [m68k/] [mvme136/] [startup/] [bspclean.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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.OARcorp.com/rtems/license.html.
10
 *
11
 *  $Id: bspclean.c,v 1.2 2001-09-27 12:00:14 chris Exp $
12
 */
13
 
14
#include <rtems.h>
15
#include <bsp.h>
16
#include <clockdrv.h>
17
#include <zilog/z8036.h>
18
 
19
void bsp_return_to_monitor_trap()
20
{
21
  extern void start( 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
 
36
void 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.