summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-02-25 23:16:13 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-05-05 11:27:56 +0200
commit50f7d2de015cd9952d1c4baec77d8fb7e48dd39d (patch)
tree3b252e335ec9af7dee43d56d49e703af568f244e
parentac3638d40bc69c4f52a44af326f7d7ce6099830b (diff)
x86/traps: Prepare for using DEFINE_IDTENTRY
Prepare for using IDTENTRY to define the C exception/trap entry points. It would be possible to glue this into the existing macro maze, but it's simpler and better to read at the end to just make them distinct. Provide a trivial inline helper to read the trap address. The existing macros will be removed once all instances are converted. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
-rw-r--r--arch/x86/kernel/traps.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index af02501ac325..b5bce7539c94 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -205,6 +205,11 @@ static void do_error_trap(struct pt_regs *regs, long error_code, char *str,
}
}
+static __always_inline void __user *error_get_trap_addr(struct pt_regs *regs)
+{
+ return (void __user *)uprobe_get_trap_addr(regs);
+}
+
#define IP ((void __user *)uprobe_get_trap_addr(regs))
#define DO_ERROR(trapnr, signr, sicode, addr, str, name) \
dotraplinkage void do_##name(struct pt_regs *regs, long error_code) \