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

4.104.114.95
Last change on this file since bbbb8f0 was bbbb8f0, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/08 at 17:27:43

2008-08-20 Sebastian Huber <sebastian.huber@…>

  • include/tm27.h: Uses now a decrementer exception handler. Replaces previous file.
  • startup/bspstart.c: Install a default decrementer exception handler.
  • 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 <libcpu/raw_exception.h>
28
29#include <bsp/ppc_exc_bspsupp.h>
30
31#define MUST_WAIT_FOR_INTERRUPT 1
32
33static rtems_isr_entry tm27_interrupt_handler = NULL;
34
35static int tm27_exception_handler( BSP_Exception_frame *frame, unsigned number)
36{
37        tm27_interrupt_handler( 0);
38
39        return 0;
40}
41
42void Install_tm27_vector( rtems_isr_entry handler)
43{
44  int rv = 0;
45
46  tm27_interrupt_handler = handler;
47
48  rv = ppc_exc_set_handler( ASM_DEC_VECTOR, tm27_exception_handler);
49  if (rv < 0) {
50    printk( "Error installing clock interrupt handler!\n");
51  }
52}
53
54#define Cause_tm27_intr() \
55  ppc_set_decrementer_register( 8)
56
57#define Clear_tm27_intr() \
58  ppc_set_decrementer_register( UINT32_MAX)
59
60#define Lower_tm27_intr() \
61  (void) ppc_external_exceptions_enable()
62
63#endif /* TMTESTS_TM27_H */
Note: See TracBrowser for help on using the repository browser.