Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2007 Michal Simek |
| 4 | * |
| 5 | * Michal SIMEK <monstr@monstr.cz> |
Michal Simek | 952d514 | 2007-03-11 13:42:58 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | typedef volatile struct microblaze_intc_t { |
| 9 | int isr; /* interrupt status register */ |
| 10 | int ipr; /* interrupt pending register */ |
| 11 | int ier; /* interrupt enable register */ |
| 12 | int iar; /* interrupt acknowledge register */ |
| 13 | int sie; /* set interrupt enable bits */ |
| 14 | int cie; /* clear interrupt enable bits */ |
| 15 | int ivr; /* interrupt vector register */ |
| 16 | int mer; /* master enable register */ |
| 17 | } microblaze_intc_t; |
| 18 | |
| 19 | struct irq_action { |
| 20 | interrupt_handler_t *handler; /* pointer to interrupt rutine */ |
| 21 | void *arg; |
| 22 | int count; /* number of interrupt */ |
| 23 | }; |
| 24 | |
Michal Simek | e76a06e | 2012-06-29 14:21:52 +0200 | [diff] [blame] | 25 | /** |
| 26 | * Register and unregister interrupt handler rutines |
| 27 | * |
| 28 | * @param irq IRQ number |
| 29 | * @param hdlr Interrupt handler rutine |
| 30 | * @param arg Pointer to argument which is passed to int. handler rutine |
| 31 | * @return 0 if registration pass, 1 if unregistration pass, |
| 32 | * or an error code < 0 otherwise |
| 33 | */ |
| 34 | int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, |
Michal Simek | 77a1e24 | 2007-05-07 17:22:25 +0200 | [diff] [blame] | 35 | void *arg); |