RTEMS 6.1-rc2
Loading...
Searching...
No Matches
arm-gic-tm27.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2013, 2014 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef _RTEMS_TMTEST27
37#error "This is an RTEMS internal file you must not include directly."
38#endif
39
40#ifndef LIBBSP_ARM_SHARED_ARM_GIC_TM27_H
41#define LIBBSP_ARM_SHARED_ARM_GIC_TM27_H
42
43#include <bsp.h>
44#include <bsp/irq.h>
45
46#include <rtems/score/assert.h>
47
48#define MUST_WAIT_FOR_INTERRUPT 1
49
50#ifndef ARM_GIC_TM27_IRQ_LOW
51#define ARM_GIC_TM27_IRQ_LOW ARM_GIC_IRQ_SGI_12
52#endif
53
54#ifndef ARM_GIC_TM27_IRQ_HIGH
55#define ARM_GIC_TM27_IRQ_HIGH ARM_GIC_IRQ_SGI_13
56#endif
57
58#define TM27_INTERRUPT_VECTOR_DEFAULT ARM_GIC_TM27_IRQ_LOW
59
60#define ARM_GIC_TM27_PRIO_LOW 0x80
61
62#define ARM_GIC_TM27_PRIO_HIGH 0x00
63
64static inline void Install_tm27_vector( rtems_interrupt_handler handler )
65{
66 static rtems_interrupt_entry entry_low;
67 static rtems_interrupt_entry entry_high;
69
70 rtems_interrupt_entry_initialize(
71 &entry_low,
72 handler,
73 NULL,
74 "tm27 low"
75 );
77 ARM_GIC_TM27_IRQ_LOW,
79 &entry_low
80 );
82
83 sc = arm_gic_irq_set_priority(
84 ARM_GIC_TM27_IRQ_LOW,
85 ARM_GIC_TM27_PRIO_LOW
86 );
88
89 rtems_interrupt_entry_initialize(
90 &entry_high,
91 handler,
92 NULL,
93 "tm27 high"
94 );
96 ARM_GIC_TM27_IRQ_HIGH,
98 &entry_high
99 );
101
102 sc = arm_gic_irq_set_priority(
103 ARM_GIC_TM27_IRQ_HIGH,
104 ARM_GIC_TM27_PRIO_HIGH
105 );
107}
108
109static inline void Cause_tm27_intr(void)
110{
112
113 sc = arm_gic_irq_generate_software_irq(
114 ARM_GIC_TM27_IRQ_LOW,
115 1U << _SMP_Get_current_processor()
116 );
118}
119
120static inline void Clear_tm27_intr(void)
121{
122 /* Nothing to do */
123}
124
125static inline void Lower_tm27_intr(void)
126{
128
129 sc = arm_gic_irq_generate_software_irq(
130 ARM_GIC_TM27_IRQ_HIGH,
131 1U << _SMP_Get_current_processor()
132 );
134}
135
136#endif /* LIBBSP_ARM_SHARED_ARM_GIC_TM27_H */
This header file provides the interfaces of the Assert Handler.
rtems_status_code rtems_interrupt_entry_install(rtems_vector_number vector, rtems_option options, rtems_interrupt_entry *entry)
Installs the interrupt entry at the interrupt vector.
Definition: irq-generic.c:264
#define RTEMS_INTERRUPT_UNIQUE
This interrupt handler install option ensures that the interrupt handler is unique.
Definition: intr.h:907
void(* rtems_interrupt_handler)(void *)
Interrupt handler routines shall have this type.
Definition: intr.h:965
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
@ RTEMS_SUCCESSFUL
This status code indicates successful completion of a requested operation.
Definition: status.h:90
#define _Assert_Unused_variable_equals(_var, _val)
Assert if unused return value is equal.
Definition: assert.h:108
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
This structure represents an interrupt entry.
Definition: intr.h:1005