RTEMS 6.1-rc7
Loading...
Searching...
No Matches
tm27.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
9/*
10 * Copyright (c) 2008 embedded brains GmbH & Co. KG
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef _RTEMS_TMTEST27
34 #error "This is an RTEMS internal file you must not include directly."
35#endif /* _RTEMS_TMTEST27 */
36
37#ifndef TMTESTS_TM27_H
38#define TMTESTS_TM27_H
39
41#include <bsp/vectors.h>
42
43#define MUST_WAIT_FOR_INTERRUPT 1
44
45static rtems_interrupt_handler tm27_interrupt_handler;
46
47static int tm27_exception_handler( BSP_Exception_frame *frame, unsigned number)
48{
49 (*tm27_interrupt_handler)( NULL);
50
51 return 0;
52}
53
54static inline void Install_tm27_vector( rtems_interrupt_handler handler )
55{
56 int rv = 0;
57
58 tm27_interrupt_handler = handler;
59
60 rv = ppc_exc_set_handler( ASM_DEC_VECTOR, tm27_exception_handler);
61 if (rv < 0) {
62 printk( "Error installing clock interrupt handler!\n");
63 }
64}
65
66#define Cause_tm27_intr() \
67 ppc_set_decrementer_register( 8)
68
69#define Clear_tm27_intr() \
70 ppc_set_decrementer_register( UINT32_MAX)
71
72#define Lower_tm27_intr() \
73 (void) ppc_external_exceptions_enable()
74
75#endif /* TMTESTS_TM27_H */
PowerPC Exceptions API.
void(* rtems_interrupt_handler)(void *)
Interrupt handler routines shall have this type.
Definition: intr.h:1030
rtems_status_code ppc_exc_set_handler(unsigned vector, ppc_exc_handler_t hdl)
Set high-level exception handler.
Definition: ppc_exc_hdl.c:73
General purpose assembler macros, linker command file support and some inline functions for direct re...
The set of registers that specifies the complete processor state.
Definition: cpu.h:446