blob: b0b3ba56e919fec8c16ca0893fda41d438a9865e [file] [log] [blame]
Thomas Gleixnercaab2772019-06-03 07:44:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Catalin Marinas10b663a2012-03-05 11:49:34 +00002/*
3 * Based on arch/arm/include/asm/exception.h
4 *
5 * Copyright (C) 2012 ARM Ltd.
Catalin Marinas10b663a2012-03-05 11:49:34 +00006 */
7#ifndef __ASM_EXCEPTION_H
8#define __ASM_EXCEPTION_H
9
James Morse68ddbf02018-01-15 19:38:59 +000010#include <asm/esr.h>
James Morseb6e43c02019-10-25 17:42:10 +010011#include <asm/kprobes.h>
James Morse68ddbf02018-01-15 19:38:59 +000012
Alexander Potapenkobe7635e2016-03-25 14:22:05 -070013#include <linux/interrupt.h>
Jungseok Lee9a5ad7d2015-08-12 15:16:19 +010014
Jungseok Lee9a5ad7d2015-08-12 15:16:19 +010015#ifdef CONFIG_FUNCTION_GRAPH_TRACER
16#define __exception_irq_entry __irq_entry
17#else
James Morseb6e43c02019-10-25 17:42:10 +010018#define __exception_irq_entry __kprobes
Jungseok Lee9a5ad7d2015-08-12 15:16:19 +010019#endif
Catalin Marinas10b663a2012-03-05 11:49:34 +000020
James Morse68ddbf02018-01-15 19:38:59 +000021static 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 Morse26718282019-08-20 18:45:57 +010033asmlinkage void enter_from_user_mode(void);
34
Catalin Marinas10b663a2012-03-05 11:49:34 +000035#endif /* __ASM_EXCEPTION_H */