Graeme Russ | 9933d60 | 2008-12-07 10:29:01 +1100 | [diff] [blame] | 1 | /* |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 2 | * (C) Copyright 2009 |
Graeme Russ | 9933d60 | 2008-12-07 10:29:01 +1100 | [diff] [blame] | 3 | * Graeme Russ, graeme.russ@gmail.com |
| 4 | * |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 5 | * (C) Copyright 2002 |
Albert ARIBAUD | fa82f87 | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 6 | * Daniel Engström, Omicron Ceti AB, daniel@omicron.se |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 7 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Graeme Russ | 9933d60 | 2008-12-07 10:29:01 +1100 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __ASM_INTERRUPT_H_ |
| 12 | #define __ASM_INTERRUPT_H_ 1 |
| 13 | |
Graeme Russ | 7228efa | 2010-10-07 20:03:23 +1100 | [diff] [blame] | 14 | #include <asm/types.h> |
| 15 | |
Bin Meng | 6c50527 | 2015-10-22 19:13:26 -0700 | [diff] [blame] | 16 | #define SYS_NUM_IRQS 16 |
| 17 | |
Bin Meng | 013cf48 | 2015-07-10 10:38:32 +0800 | [diff] [blame] | 18 | /* Architecture defined exceptions */ |
| 19 | enum x86_exception { |
| 20 | EXC_DE = 0, |
| 21 | EXC_DB, |
| 22 | EXC_NMI, |
| 23 | EXC_BP, |
| 24 | EXC_OF, |
| 25 | EXC_BR, |
| 26 | EXC_UD, |
| 27 | EXC_NM, |
| 28 | EXC_DF, |
| 29 | EXC_CSO, |
| 30 | EXC_TS, |
| 31 | EXC_NP, |
| 32 | EXC_SS, |
| 33 | EXC_GP, |
| 34 | EXC_PF, |
| 35 | EXC_MF = 16, |
| 36 | EXC_AC, |
| 37 | EXC_MC, |
| 38 | EXC_XM, |
| 39 | EXC_VE |
| 40 | }; |
| 41 | |
Graeme Russ | fea2572 | 2011-04-13 19:43:28 +1000 | [diff] [blame] | 42 | /* arch/x86/cpu/interrupts.c */ |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 43 | void set_vector(u8 intnum, void *routine); |
| 44 | |
Graeme Russ | abf0cd3 | 2009-02-24 21:13:40 +1100 | [diff] [blame] | 45 | /* Architecture specific functions */ |
| 46 | void mask_irq(int irq); |
| 47 | void unmask_irq(int irq); |
| 48 | void specific_eoi(int irq); |
| 49 | |
| 50 | extern char exception_stack[]; |
| 51 | |
Simon Glass | a0bd851 | 2014-11-14 18:18:31 -0700 | [diff] [blame] | 52 | /** |
| 53 | * configure_irq_trigger() - Configure IRQ triggering |
| 54 | * |
| 55 | * Switch the given interrupt to be level / edge triggered |
| 56 | * |
| 57 | * @param int_num legacy interrupt number (3-7, 9-15) |
| 58 | * @param is_level_triggered true for level triggered interrupt, false for |
| 59 | * edge triggered interrupt |
| 60 | */ |
| 61 | void configure_irq_trigger(int int_num, bool is_level_triggered); |
| 62 | |
Simon Glass | 6f41e0e7b | 2015-04-28 20:25:16 -0600 | [diff] [blame] | 63 | void *x86_get_idt(void); |
| 64 | |
Graeme Russ | 9933d60 | 2008-12-07 10:29:01 +1100 | [diff] [blame] | 65 | #endif |