1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ARM64_ASM_SIGNAL_H
3#define __ARM64_ASM_SIGNAL_H
4
5#include <asm/memory.h>
6#include <uapi/asm/signal.h>
7#include <uapi/asm/siginfo.h>
8
9static inline void __user *arch_untagged_si_addr(void __user *addr,
10						 unsigned long sig,
11						 unsigned long si_code)
12{
13	/*
14	 * For historical reasons, all bits of the fault address are exposed as
15	 * address bits for watchpoint exceptions. New architectures should
16	 * handle the tag bits consistently.
17	 */
18	if (sig == SIGTRAP && si_code == TRAP_BRKPT)
19		return addr;
20
21	return untagged_addr(addr);
22}
23#define arch_untagged_si_addr arch_untagged_si_addr
24
25#endif
26