RTEMS 6.1-rc7
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 VIRTEX_IRQ_IRQ_H
35#define VIRTEX_IRQ_IRQ_H
36
37#include <rtems/irq.h>
38#include <rtems/irq-extension.h>
39#include <bsp/opbintctrl.h>
40
41/*
42 * the following definitions specify the indices used
43 * to interface the interrupt handler API
44 */
45
46/*
47 * Peripheral IRQ handlers related definitions
48 */
49#define BSP_OPBINTC_PER_IRQ_NUMBER XPAR_INTC_MAX_NUM_INTR_INPUTS
50#define BSP_OPBINTC_IRQ_LOWEST_OFFSET 0
51#define BSP_OPBINTC_IRQ_MAX_OFFSET (BSP_OPBINTC_IRQ_LOWEST_OFFSET\
52 +BSP_OPBINTC_PER_IRQ_NUMBER-1)
53
54#define BSP_IS_OPBINTC_IRQ(irqnum) \
55 (((irqnum) >= BSP_OPBINTC_IRQ_LOWEST_OFFSET) && \
56 ((irqnum) <= BSP_OPBINTC_IRQ_MAX_OFFSET))
57/*
58 * Processor IRQ handlers related definitions
59 */
60#define BSP_PROCESSOR_IRQ_NUMBER 3
61#define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_OPBINTC_IRQ_MAX_OFFSET+1)
62#define BSP_PROCESSOR_IRQ_MAX_OFFSET (BSP_PROCESSOR_IRQ_LOWEST_OFFSET\
63 +BSP_PROCESSOR_IRQ_NUMBER-1)
64
65#define BSP_IS_PROCESSOR_IRQ(irqnum) \
66 (((irqnum) >= BSP_PROCESSOR_IRQ_LOWEST_OFFSET) && \
67 ((irqnum) <= BSP_PROCESSOR_IRQ_MAX_OFFSET))
68/*
69 * Summary
70 */
71#define BSP_IRQ_NUMBER (BSP_PROCESSOR_IRQ_MAX_OFFSET+1)
72#define BSP_LOWEST_OFFSET BSP_OPBINTC_IRQ_LOWEST_OFFSET
73#define BSP_MAX_OFFSET BSP_PROCESSOR_IRQ_MAX_OFFSET
74
75#define BSP_IS_VALID_IRQ(irqnum) \
76 (BSP_IS_PROCESSOR_IRQ(irqnum) \
77 || BSP_IS_OPBINTC_IRQ(irqnum))
78
79#define BSP_INTERRUPT_VECTOR_COUNT (BSP_PROCESSOR_IRQ_MAX_OFFSET + 1)
80
81#ifndef ASM
82#ifdef __cplusplus
83extern "C" {
84#endif
85
86/*
87 * index table for the module specific handlers, a few entries are only placeholders
88 */
89 typedef enum {
90 BSP_OPBINTC_IRQ_FIRST = BSP_OPBINTC_IRQ_LOWEST_OFFSET,
91 /*
92 * Note: for this BSP, the peripheral names are derived
93 * from the Xilinx parameter file
94 */
95 BSP_OPBINTC_IRQ_LAST = BSP_OPBINTC_IRQ_MAX_OFFSET,
96 BSP_EXT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 0,
97 BSP_PIT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 1,
98 BSP_CRIT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 2
99 } rtems_irq_symbolic_name;
100
101#define BSP_OPBINTC_XPAR(xname) (BSP_OPBINTC_IRQ_LOWEST_OFFSET+xname)
102
103#ifdef __cplusplus
104}
105#endif
106#endif /* ASM */
107
108#endif /* VIRTEX_IRQ_IRQ_H */
This header file is provided for backward compatiblility.