RTEMS 6.1-rc1
arm-gic-irq.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2013, 2019 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 LIBBSP_ARM_SHARED_ARM_GIC_IRQ_H
37#define LIBBSP_ARM_SHARED_ARM_GIC_IRQ_H
38
39#include <bsp.h>
40#include <dev/irq/arm-gic.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif /* __cplusplus */
46
47#define ARM_GIC_IRQ_SGI_0 0
48#define ARM_GIC_IRQ_SGI_1 1
49#define ARM_GIC_IRQ_SGI_2 2
50#define ARM_GIC_IRQ_SGI_3 3
51#define ARM_GIC_IRQ_SGI_5 5
52#define ARM_GIC_IRQ_SGI_6 6
53#define ARM_GIC_IRQ_SGI_7 7
54#define ARM_GIC_IRQ_SGI_8 8
55#define ARM_GIC_IRQ_SGI_9 9
56#define ARM_GIC_IRQ_SGI_10 10
57#define ARM_GIC_IRQ_SGI_11 11
58#define ARM_GIC_IRQ_SGI_12 12
59#define ARM_GIC_IRQ_SGI_13 13
60#define ARM_GIC_IRQ_SGI_14 14
61#define ARM_GIC_IRQ_SGI_15 15
62#define ARM_GIC_IRQ_SGI_LAST 15
63
64#define ARM_GIC_IRQ_PPI_LAST 31
65
66#define ARM_GIC_DIST ((volatile gic_dist *) BSP_ARM_GIC_DIST_BASE)
67
68rtems_status_code arm_gic_irq_set_priority(
70 uint8_t priority
71);
72
73rtems_status_code arm_gic_irq_get_priority(
75 uint8_t *priority
76);
77
78rtems_status_code arm_gic_irq_set_group(
80 gic_group group
81);
82
83rtems_status_code arm_gic_irq_get_group(
85 gic_group *group
86);
87
88rtems_status_code bsp_interrupt_set_affinity(
90 const Processor_mask *affinity
91);
92
93rtems_status_code bsp_interrupt_get_affinity(
95 Processor_mask *affinity
96);
97
98void arm_gic_trigger_sgi(rtems_vector_number vector, uint32_t targets);
99
100static inline rtems_status_code arm_gic_irq_generate_software_irq(
101 rtems_vector_number vector,
102 uint32_t targets
103)
104{
106
107 if (vector <= ARM_GIC_IRQ_SGI_15) {
108 arm_gic_trigger_sgi(vector, targets);
109 } else {
110 sc = RTEMS_INVALID_ID;
111 }
112
113 return sc;
114}
115
116uint32_t arm_gic_irq_processor_count(void);
117
118void arm_gic_irq_initialize_secondary_cpu(void);
119
120#ifdef __cplusplus
121}
122#endif /* __cplusplus */
123
124#endif /* LIBBSP_ARM_SHARED_ARM_GIC_IRQ_H */
ARM GIC Support.
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
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
@ RTEMS_INVALID_ID
This status code indicates that an object identifier was invalid.
Definition: status.h:110
This header file provides the interfaces of the Processor Mask.