RTEMS  5.1
tm27.h
Go to the documentation of this file.
1 
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
16  * found in the file LICENSE in this distribution or at
17  * http://www.rtems.org/license/LICENSE.
18  */
19 
20 #ifndef _RTEMS_TMTEST27
21  #error "This is an RTEMS internal file you must not include directly."
22 #endif /* _RTEMS_TMTEST27 */
23 
24 #ifndef TMTESTS_TM27_H
25 #define TMTESTS_TM27_H
26 
27 #include <libcpu/powerpc-utility.h>
28 #include <bsp/vectors.h>
29 
30 #define MUST_WAIT_FOR_INTERRUPT 1
31 
32 static void (*tm27_interrupt_handler)(rtems_vector_number);
33 
34 static int tm27_exception_handler( BSP_Exception_frame *frame, unsigned number)
35 {
36  (*tm27_interrupt_handler)( 0);
37 
38  return 0;
39 }
40 
41 static void Install_tm27_vector( void (*handler)(rtems_vector_number))
42 {
43  int rv = 0;
44 
45  tm27_interrupt_handler = handler;
46 
47  rv = ppc_exc_set_handler( ASM_DEC_VECTOR, tm27_exception_handler);
48  if (rv < 0) {
49  printk( "Error installing clock interrupt handler!\n");
50  }
51 }
52 
53 #define Cause_tm27_intr() \
54  ppc_set_decrementer_register( 8)
55 
56 #define Clear_tm27_intr() \
57  ppc_set_decrementer_register( UINT32_MAX)
58 
59 #define Lower_tm27_intr() \
60  (void) ppc_external_exceptions_enable()
61 
62 #endif /* TMTESTS_TM27_H */
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
PowerPC Exceptions API.
General purpose assembler macros, linker command file support and some inline functions for direct re...
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
The set of registers that specifies the complete processor state.
Definition: cpu.h:629
int printk(const char *fmt,...) RTEMS_PRINTFLIKE(1
Kernel Print.