xref: /OK3568_Linux_fs/u-boot/arch/microblaze/include/asm/microblaze_intc.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2007 Michal Simek
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Michal  SIMEK <monstr@monstr.cz>
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun typedef volatile struct microblaze_intc_t {
10*4882a593Smuzhiyun 	int isr; /* interrupt status register */
11*4882a593Smuzhiyun 	int ipr; /* interrupt pending register */
12*4882a593Smuzhiyun 	int ier; /* interrupt enable register */
13*4882a593Smuzhiyun 	int iar; /* interrupt acknowledge register */
14*4882a593Smuzhiyun 	int sie; /* set interrupt enable bits */
15*4882a593Smuzhiyun 	int cie; /* clear interrupt enable bits */
16*4882a593Smuzhiyun 	int ivr; /* interrupt vector register */
17*4882a593Smuzhiyun 	int mer; /* master enable register */
18*4882a593Smuzhiyun } microblaze_intc_t;
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun struct irq_action {
21*4882a593Smuzhiyun 	interrupt_handler_t *handler; /* pointer to interrupt rutine */
22*4882a593Smuzhiyun 	void *arg;
23*4882a593Smuzhiyun 	int count; /* number of interrupt */
24*4882a593Smuzhiyun };
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun /**
27*4882a593Smuzhiyun  * Register and unregister interrupt handler rutines
28*4882a593Smuzhiyun  *
29*4882a593Smuzhiyun  * @param irq	IRQ number
30*4882a593Smuzhiyun  * @param hdlr	Interrupt handler rutine
31*4882a593Smuzhiyun  * @param arg	Pointer to argument which is passed to int. handler rutine
32*4882a593Smuzhiyun  * @return	0 if registration pass, 1 if unregistration pass,
33*4882a593Smuzhiyun  *		or an error code < 0 otherwise
34*4882a593Smuzhiyun  */
35*4882a593Smuzhiyun int install_interrupt_handler(int irq, interrupt_handler_t *hdlr,
36*4882a593Smuzhiyun 				       void *arg);
37