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