1 | /* |
---|
2 | * Copyright (c) 2013 embedded brains GmbH. All rights reserved. |
---|
3 | * |
---|
4 | * embedded brains GmbH |
---|
5 | * Dornierstr. 4 |
---|
6 | * 82178 Puchheim |
---|
7 | * Germany |
---|
8 | * <info@embedded-brains.de> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #ifndef _RTEMS_TMTEST27 |
---|
16 | #error "This is an RTEMS internal file you must not include directly." |
---|
17 | #endif |
---|
18 | |
---|
19 | #ifndef LIBBSP_ARM_SHARED_ARM_GIC_TM27_H |
---|
20 | #define LIBBSP_ARM_SHARED_ARM_GIC_TM27_H |
---|
21 | |
---|
22 | #include <assert.h> |
---|
23 | |
---|
24 | #include <bsp.h> |
---|
25 | #include <bsp/irq.h> |
---|
26 | |
---|
27 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
28 | |
---|
29 | #define ARM_GIC_TM27_IRQ ARM_GIC_IRQ_SGI_13 |
---|
30 | |
---|
31 | #define ARM_GIC_TM27_PRIO_LOW 0xfe |
---|
32 | |
---|
33 | #define ARM_GIC_TM27_PRIO_HIGH 0x00 |
---|
34 | |
---|
35 | static inline void Install_tm27_vector(void (*handler)(rtems_vector_number)) |
---|
36 | { |
---|
37 | rtems_status_code sc = rtems_interrupt_handler_install( |
---|
38 | ARM_GIC_TM27_IRQ, |
---|
39 | "TM27", |
---|
40 | RTEMS_INTERRUPT_UNIQUE, |
---|
41 | (rtems_interrupt_handler) handler, |
---|
42 | NULL |
---|
43 | ); |
---|
44 | assert(sc == RTEMS_SUCCESSFUL); |
---|
45 | |
---|
46 | sc = arm_gic_irq_set_priority( |
---|
47 | ARM_GIC_TM27_IRQ, |
---|
48 | ARM_GIC_TM27_PRIO_LOW |
---|
49 | ); |
---|
50 | assert(sc == RTEMS_SUCCESSFUL); |
---|
51 | } |
---|
52 | |
---|
53 | static inline void Cause_tm27_intr(void) |
---|
54 | { |
---|
55 | rtems_status_code sc = arm_gic_irq_generate_software_irq( |
---|
56 | ARM_GIC_TM27_IRQ, |
---|
57 | ARM_GIC_IRQ_SOFTWARE_IRQ_TO_SELF, |
---|
58 | 0 |
---|
59 | ); |
---|
60 | assert(sc == RTEMS_SUCCESSFUL); |
---|
61 | } |
---|
62 | |
---|
63 | static inline void Clear_tm27_intr(void) |
---|
64 | { |
---|
65 | rtems_status_code sc = arm_gic_irq_set_priority( |
---|
66 | ARM_GIC_TM27_IRQ, |
---|
67 | ARM_GIC_TM27_PRIO_LOW |
---|
68 | ); |
---|
69 | assert(sc == RTEMS_SUCCESSFUL); |
---|
70 | } |
---|
71 | |
---|
72 | static inline void Lower_tm27_intr(void) |
---|
73 | { |
---|
74 | rtems_status_code sc = arm_gic_irq_set_priority( |
---|
75 | ARM_GIC_TM27_IRQ, |
---|
76 | ARM_GIC_TM27_PRIO_HIGH |
---|
77 | ); |
---|
78 | assert(sc == RTEMS_SUCCESSFUL); |
---|
79 | } |
---|
80 | |
---|
81 | #endif /* LIBBSP_ARM_SHARED_ARM_GIC_TM27_H */ |
---|