source: rtems/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c @ 4269a43

4.104.114.84.95
Last change on this file since 4269a43 was 4269a43, checked in by Joel Sherrill <joel.sherrill@…>, on 11/01/02 at 23:10:45

2002-11-01 Joel Sherrill <joel@…>

  • console/console.c, start/start.c, startup/efi68k_wd.c:
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
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$
17 */
18#include <bsp.h>
19
20void 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 */
31extern void _catchWDint();
32asm("   .text\n\
33        .align 2\n\
34        .globl _catchWDint\n\
35_catchWDint:\n\
36        lea    %sp@(4),%sp                /* pop return address */\n\
37        moveml %d0-%d7/%a0-%a6,%sp@-       /* save registers */\n\
38        jbsr    wd_interrupt\n\
39        moveml  %sp@+,%d0-%d7/%a0-%a6                           \n\
40        rte\n\
41    ");
42
43void watch_dog_init(void) {
44  set_vector(_catchWDint, WD_ISR_LEVEL+24, 0);
45}
Note: See TracBrowser for help on using the repository browser.