OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *-------------------------------------------------------------------
3
 *
4
 * This file contains the subroutines necessary to initalize
5
 * and maintain the MAX791 based watchdog timer used on efi68k
6
 *
7
 * This file has been created by John S. Gwynne for the efi68k
8
 * project.
9
 *
10
 *  The license and distribution terms for this file may in
11
 *  the file LICENSE in this distribution or at
12
 *  http://www.OARcorp.com/rtems/license.html.
13
 *
14
 *------------------------------------------------------------------
15
 *
16
 *  $Id: efi68k_wd.c,v 1.2 2001-09-27 12:00:03 chris Exp $
17
 */
18
#include <bsp.h>
19
 
20
void wd_interrupt(void) {
21
  /* toggle WDI of the MAX791. A more sophisticated routine
22
     can be inserted into the exception table after booting. */
23
 
24
  /* 3 changes guaranty a pulse independent of initial state */
25
  *MCR |= OUT1;
26
  *MCR &= ~OUT1;
27
  *MCR |= OUT1;
28
}
29
 
30
/* _catchWDint is the interrupt front-end */
31
extern void _catchWDint();
32
asm("   .text
33
        .align 2
34
        .globl _catchWDint
35
_catchWDint:
36
        lea    %sp@(4),%sp                /* pop return address */
37
        moveml %d0-%d7/%a0-%a6,%sp@-       /* save registers */
38
        jbsr    wd_interrupt
39
        moveml  %sp@+,%d0-%d7/%a0-%a6
40
        rte
41
    ");
42
 
43
void watch_dog_init(void) {
44
  set_vector(_catchWDint, WD_ISR_LEVEL+24, 0);
45
}

powered by: WebSVN 2.1.0

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