source: rtems/c/src/lib/libbsp/powerpc/gen83xx/include/tm27.h @ 2d2de4eb

4.104.115
Last change on this file since 2d2de4eb was 2d2de4eb, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 10/23/09 at 07:32:46

Update for exception support changes.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief Support file for Timer Test 27.
5 */
6
7/*
8 * Copyright (c) 2008
9 * Embedded Brains GmbH
10 * Obere Lagerstr. 30
11 * D-82178 Puchheim
12 * Germany
13 * rtems@embedded-brains.de
14 *
15 * The license and distribution terms for this file may be found in the file
16 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
17 */
18
19#ifndef _RTEMS_TMTEST27
20  #error "This is an RTEMS internal file you must not include directly."
21#endif /* _RTEMS_TMTEST27 */
22
23#ifndef TMTESTS_TM27_H
24#define TMTESTS_TM27_H
25
26#include <libcpu/powerpc-utility.h>
27#include <bsp/vectors.h>
28
29#define MUST_WAIT_FOR_INTERRUPT 1
30
31static rtems_isr_entry tm27_interrupt_handler = NULL;
32
33static int tm27_exception_handler( BSP_Exception_frame *frame, unsigned number)
34{
35        tm27_interrupt_handler( 0);
36
37        return 0;
38}
39
40void Install_tm27_vector( rtems_isr_entry handler)
41{
42  int rv = 0;
43
44  tm27_interrupt_handler = handler;
45
46  rv = ppc_exc_set_handler( ASM_DEC_VECTOR, tm27_exception_handler);
47  if (rv < 0) {
48    printk( "Error installing clock interrupt handler!\n");
49  }
50}
51
52#define Cause_tm27_intr() \
53  ppc_set_decrementer_register( 8)
54
55#define Clear_tm27_intr() \
56  ppc_set_decrementer_register( UINT32_MAX)
57
58#define Lower_tm27_intr() \
59  (void) ppc_external_exceptions_enable()
60
61#endif /* TMTESTS_TM27_H */
Note: See TracBrowser for help on using the repository browser.