Thomas Gleixner | caab277 | 2019-06-03 07:44:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Catalin Marinas | 10b663a | 2012-03-05 11:49:34 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Based on arch/arm/include/asm/exception.h |
| 4 | * |
| 5 | * Copyright (C) 2012 ARM Ltd. |
Catalin Marinas | 10b663a | 2012-03-05 11:49:34 +0000 | [diff] [blame] | 6 | */ |
| 7 | #ifndef __ASM_EXCEPTION_H |
| 8 | #define __ASM_EXCEPTION_H |
| 9 | |
James Morse | 68ddbf0 | 2018-01-15 19:38:59 +0000 | [diff] [blame] | 10 | #include <asm/esr.h> |
James Morse | b6e43c0 | 2019-10-25 17:42:10 +0100 | [diff] [blame^] | 11 | #include <asm/kprobes.h> |
James Morse | 68ddbf0 | 2018-01-15 19:38:59 +0000 | [diff] [blame] | 12 | |
Alexander Potapenko | be7635e | 2016-03-25 14:22:05 -0700 | [diff] [blame] | 13 | #include <linux/interrupt.h> |
Jungseok Lee | 9a5ad7d | 2015-08-12 15:16:19 +0100 | [diff] [blame] | 14 | |
Jungseok Lee | 9a5ad7d | 2015-08-12 15:16:19 +0100 | [diff] [blame] | 15 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 16 | #define __exception_irq_entry __irq_entry |
| 17 | #else |
James Morse | b6e43c0 | 2019-10-25 17:42:10 +0100 | [diff] [blame^] | 18 | #define __exception_irq_entry __kprobes |
Jungseok Lee | 9a5ad7d | 2015-08-12 15:16:19 +0100 | [diff] [blame] | 19 | #endif |
Catalin Marinas | 10b663a | 2012-03-05 11:49:34 +0000 | [diff] [blame] | 20 | |
James Morse | 68ddbf0 | 2018-01-15 19:38:59 +0000 | [diff] [blame] | 21 | static inline u32 disr_to_esr(u64 disr) |
| 22 | { |
| 23 | unsigned int esr = ESR_ELx_EC_SERROR << ESR_ELx_EC_SHIFT; |
| 24 | |
| 25 | if ((disr & DISR_EL1_IDS) == 0) |
| 26 | esr |= (disr & DISR_EL1_ESR_MASK); |
| 27 | else |
| 28 | esr |= (disr & ESR_ELx_ISS_MASK); |
| 29 | |
| 30 | return esr; |
| 31 | } |
| 32 | |
James Morse | 2671828 | 2019-08-20 18:45:57 +0100 | [diff] [blame] | 33 | asmlinkage void enter_from_user_mode(void); |
| 34 | |
Catalin Marinas | 10b663a | 2012-03-05 11:49:34 +0000 | [diff] [blame] | 35 | #endif /* __ASM_EXCEPTION_H */ |