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