RTEMS 7.0-rc1
Loading...
Searching...
No Matches
irq.h
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * RTEMS virtex BSP
5 *
6 * This file declares constants of the interrupt controller.
7 */
8
9/*
10 * Copyright (c) 2007 embedded brains GmbH & Co. KG
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef VIRTEX5_IRQ_IRQ_H
35#define VIRTEX5_IRQ_IRQ_H
36
37#include <rtems/irq.h>
38#include <bsp/irq-default.h>
39
40/*
41 * the following definitions specify the indices used
42 * to interface the interrupt handler API
43 */
44
45/*
46 * Peripheral IRQ handlers related definitions
47 */
48 /* Not supported at this level */
49
50/*
51 * Processor IRQ handlers related definitions
52 */
53#define BSP_PROCESSOR_IRQ_NUMBER 3
54#define BSP_PROCESSOR_IRQ_LOWEST_OFFSET 0
55#define BSP_PROCESSOR_IRQ_MAX_OFFSET (BSP_PROCESSOR_IRQ_LOWEST_OFFSET\
56 +BSP_PROCESSOR_IRQ_NUMBER-1)
57
58/*
59 * The GCC warning -Wtype-limits flagged that the
60 * ((irqnum) >= BSP_PROCESSOR_IRQ_LOWEST_OFFSET) part of the expression was
61 * not needed because irqLine is unsigned and BSP_SIU_IRQ_MAX_OFFSET is 0.
62*/
63#define BSP_IS_PROCESSOR_IRQ(irqnum) \
64 ((irqnum) <= BSP_PROCESSOR_IRQ_MAX_OFFSET)
65
66/*
67 * Summary
68 */
69#define BSP_IRQ_NUMBER (BSP_PROCESSOR_IRQ_MAX_OFFSET+1)
70#define BSP_LOWEST_OFFSET BSP_PROCESSOR_IRQ_LOWEST_OFFSET
71#define BSP_MAX_OFFSET BSP_PROCESSOR_IRQ_MAX_OFFSET
72
73#define BSP_IS_VALID_IRQ(irqnum) (BSP_IS_PROCESSOR_IRQ(irqnum))
74
75#ifndef ASM
76#ifdef __cplusplus
77extern "C" {
78#endif
79
80/*
81 * index table for the module specific handlers, a few entries are only placeholders
82 */
83 typedef enum {
84 BSP_EXT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 0,
85 BSP_PIT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 1,
86 BSP_CRIT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 2
87 } rtems_irq_symbolic_name;
88
89 extern rtems_irq_connect_data *BSP_rtems_irq_tbl;
90 void BSP_irqexc_on_fnc(const rtems_irq_connect_data *conn_data);
91 void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused);
92 void BSP_rtems_irq_mngt_init(unsigned cpuId);
93
94#define BSP_DEC BSP_PIT
95#define BSP_DECREMENTER BSP_PIT
96
97#ifdef __cplusplus
98}
99#endif
100#endif /* ASM */
101
102#endif /* VIRTEX5_IRQ_IRQ_H */
Interrupt Handler Support.
Definition: irq.h:65