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 VIRTEX4_IRQ_IRQ_H
35#define VIRTEX4_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#define BSP_IS_PROCESSOR_IRQ(irqnum) \
59 (((irqnum) >= BSP_PROCESSOR_IRQ_LOWEST_OFFSET) && \
60 ((irqnum) <= BSP_PROCESSOR_IRQ_MAX_OFFSET))
61
62/*
63 * Summary
64 */
65#define BSP_IRQ_NUMBER (BSP_PROCESSOR_IRQ_MAX_OFFSET+1)
66#define BSP_LOWEST_OFFSET BSP_PROCESSOR_IRQ_LOWEST_OFFSET
67#define BSP_MAX_OFFSET BSP_PROCESSOR_IRQ_MAX_OFFSET
68
69#define BSP_IS_VALID_IRQ(irqnum) (BSP_IS_PROCESSOR_IRQ(irqnum))
70
71#ifndef ASM
72#ifdef __cplusplus
73extern "C" {
74#endif
75
76/*
77 * index table for the module specific handlers, a few entries are only placeholders
78 */
79 typedef enum {
80 BSP_EXT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 0,
81 BSP_PIT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 1,
82 BSP_CRIT = BSP_PROCESSOR_IRQ_LOWEST_OFFSET + 2
83 } rtems_irq_symbolic_name;
84
85 extern rtems_irq_connect_data *BSP_rtems_irq_tbl;
86 void BSP_irqexc_on_fnc(const rtems_irq_connect_data *conn_data);
87 void BSP_irqexc_off_fnc(const rtems_irq_connect_data *unused);
88 void BSP_rtems_irq_mngt_init(unsigned cpuId);
89
90#ifdef __cplusplus
91}
92#endif
93#endif /* ASM */
94
95#endif /* VIRTEX4_IRQ_IRQ_H */
Definition: irq.h:64