source: rtems/c/src/lib/libbsp/m68k/efi68k/startup/efi68k_wd.c @ 486c329

4.104.114.84.95
Last change on this file since 486c329 was 486c329, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 20, 1995 at 3:05:19 PM

Actually adding efi bsp's from John Gwynne after forgetting to
commit them.

  • Property mode set to 100644
File size: 1.7 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 * Redistribution and use in source and binary forms are permitted
11 * provided that the following conditions are met:
12 * 1. Redistribution of source code and documentation must retain
13 *    the above authorship, this list of conditions and the
14 *    following disclaimer.
15 * 2. The name of the author may not be used to endorse or promote
16 *    products derived from this software without specific prior
17 *    written permission.
18 *
19 * This software is provided "AS IS" without warranty of any kind,
20 * either expressed or implied, including, but not limited to, the
21 * implied warranties of merchantability, title and fitness for a
22 * particular purpose.
23 *
24 *------------------------------------------------------------------
25 *
26 *  $Id$
27 */
28#include <bsp.h>
29
30void wd_interrupt(void) {
31  /* toggle WDI of the MAX791. A more sophisticated routine
32     can be inserted into the exception table after booting. */
33
34  /* 3 changes guaranty a pulse independent of initial state */
35  *MCR |= OUT1;
36  *MCR &= ~OUT1;
37  *MCR |= OUT1;
38}
39
40/* _catchWDint is the interrupt front-end */
41extern void _catchWDint();
42asm("   .text
43        .align 2
44        .globl _catchWDint
45_catchWDint:
46        lea    %sp@(4),%sp                /* pop return address */
47        moveml %d0-%d7/%a0-%a6,%sp@-       /* save registers */
48        jbsr    wd_interrupt
49        moveml  %sp@+,%d0-%d7/%a0-%a6                           
50        rte
51    ");
52
53void watch_dog_init(void) {
54  set_vector(_catchWDint, WD_ISR_LEVEL+24, 0);
55}
Note: See TracBrowser for help on using the repository browser.