blob: fdeb85711323b59c139d3fa0f2695a453a833ef6 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Graeme Russ9933d602008-12-07 10:29:01 +11002/*
Graeme Russabf0cd32009-02-24 21:13:40 +11003 * (C) Copyright 2009
Graeme Russ9933d602008-12-07 10:29:01 +11004 * Graeme Russ, graeme.russ@gmail.com
5 *
Graeme Russabf0cd32009-02-24 21:13:40 +11006 * (C) Copyright 2002
Albert ARIBAUDfa82f872011-08-04 18:45:45 +02007 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
Graeme Russ9933d602008-12-07 10:29:01 +11008 */
9
10#ifndef __ASM_INTERRUPT_H_
11#define __ASM_INTERRUPT_H_ 1
12
Graeme Russ7228efa2010-10-07 20:03:23 +110013#include <asm/types.h>
14
Bin Meng6c505272015-10-22 19:13:26 -070015#define SYS_NUM_IRQS 16
16
Bin Meng013cf482015-07-10 10:38:32 +080017/* Architecture defined exceptions */
18enum x86_exception {
19 EXC_DE = 0,
20 EXC_DB,
21 EXC_NMI,
22 EXC_BP,
23 EXC_OF,
24 EXC_BR,
25 EXC_UD,
26 EXC_NM,
27 EXC_DF,
28 EXC_CSO,
29 EXC_TS,
30 EXC_NP,
31 EXC_SS,
32 EXC_GP,
33 EXC_PF,
34 EXC_MF = 16,
35 EXC_AC,
36 EXC_MC,
37 EXC_XM,
38 EXC_VE
39};
40
Graeme Russfea25722011-04-13 19:43:28 +100041/* arch/x86/cpu/interrupts.c */
Graeme Russabf0cd32009-02-24 21:13:40 +110042void set_vector(u8 intnum, void *routine);
43
Graeme Russabf0cd32009-02-24 21:13:40 +110044/* Architecture specific functions */
45void mask_irq(int irq);
46void unmask_irq(int irq);
47void specific_eoi(int irq);
48
49extern char exception_stack[];
50
Simon Glassa0bd8512014-11-14 18:18:31 -070051/**
52 * configure_irq_trigger() - Configure IRQ triggering
53 *
54 * Switch the given interrupt to be level / edge triggered
55 *
56 * @param int_num legacy interrupt number (3-7, 9-15)
57 * @param is_level_triggered true for level triggered interrupt, false for
58 * edge triggered interrupt
59 */
60void configure_irq_trigger(int int_num, bool is_level_triggered);
61
Simon Glass6f41e0e7b2015-04-28 20:25:16 -060062void *x86_get_idt(void);
63
Graeme Russ9933d602008-12-07 10:29:01 +110064#endif