David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Based on arch/arm/include/asm/exception.h |
| 4 | * |
| 5 | * Copyright (C) 2012 ARM Ltd. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | */ |
| 7 | #ifndef __ASM_EXCEPTION_H |
| 8 | #define __ASM_EXCEPTION_H |
| 9 | |
| 10 | #include <asm/esr.h> |
| 11 | |
| 12 | #include <linux/interrupt.h> |
| 13 | |
| 14 | #define __exception __attribute__((section(".exception.text"))) |
| 15 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 16 | #define __exception_irq_entry __irq_entry |
| 17 | #else |
| 18 | #define __exception_irq_entry __exception |
| 19 | #endif |
| 20 | |
| 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 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 33 | asmlinkage void enter_from_user_mode(void); |
| 34 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 35 | #endif /* __ASM_EXCEPTION_H */ |