RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / cfe / cfe / include / cfe_irq.h
blob7605b5e3484129adaf499f00dcc1454c4348d83c
1 /* *********************************************************************
2 * Broadcom Common Firmware Environment (CFE)
3 *
4 * IRQ related definitions File: cfe_irq.h
5 *
6 * This module describes CFE's interface for dispatching
7 * to driver-supplied service routines. Dispatch can be based
8 * either on asynchronous interrupt events or on synchrnous
9 * polling of the interrupt status registers from the idle loop.
11 * The interface attempts to accomodate the concept of interrupt
12 * mapping as is common on high-integration parts with standard
13 * cores. The details are motivated by the bcm1250/MIPS
14 * architecture, where the mapping abstraction is somewhat violated
15 * by CP0 interrupts that do not go through the mapper.
17 *********************************************************************
19 * Copyright 2000,2001,2002,2003
20 * Broadcom Corporation. All rights reserved.
22 * This software is furnished under license and may be used and
23 * copied only in accordance with the following terms and
24 * conditions. Subject to these conditions, you may download,
25 * copy, install, use, modify and distribute modified or unmodified
26 * copies of this software in source and/or binary form. No title
27 * or ownership is transferred hereby.
29 * 1) Any source code used, modified or distributed must reproduce
30 * and retain this copyright notice and list of conditions
31 * as they appear in the source file.
33 * 2) No right is granted to use any trade name, trademark, or
34 * logo of Broadcom Corporation. The "Broadcom Corporation"
35 * name may not be used to endorse or promote products derived
36 * from this software without the prior written permission of
37 * Broadcom Corporation.
39 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
40 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
41 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
42 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
43 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
44 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
45 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
46 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
47 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
48 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
49 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
50 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
51 * THE POSSIBILITY OF SUCH DAMAGE.
52 ********************************************************************* */
54 /* *********************************************************************
55 * Constants
56 ********************************************************************* */
58 #define NR_IRQS 64
60 #define CFE_IRQ_FLAGS_SHARED 0x1
62 /* *********************************************************************
63 * Structures
64 ********************************************************************* */
66 /* *********************************************************************
67 * Functions
68 ********************************************************************* */
70 void cfe_irq_init(void);
73 /* Functions that use interrupt mapping, i.e., the irq argument is the
74 interrupt number at the input to the mapper. */
76 void cfe_mask_irq(int cpu, unsigned int irq);
77 void cfe_unmask_irq(int cpu, unsigned int irq);
79 void cfe_enable_irq(unsigned int irq);
80 void cfe_disable_irq(unsigned int irq);
82 int cfe_request_irq(unsigned int irq,
83 void (*handler)(void *), void *arg,
84 unsigned long irqflags, int device);
85 void cfe_free_irq(unsigned int irq, int device);
87 /* pseudo-interrupts, by polling request lines and invoking handlers */
89 void cfe_irq_poll(void *);
92 /* Functions that bypass interrupt mapping, i.e., the ip argument
93 is the interrupt number at the output of the mapper and/or the
94 input to the CPU. */
96 typedef void (* ip_handler_t)(int ip);
98 void cfe_irq_setvector(int ip, ip_handler_t handler);
100 /* enable/disable interrupts at the CPU level. */
102 void cfe_irq_enable(int mask);
103 int cfe_irq_disable(void);