From 89e149d275a7699a4a5e4c98bab267648f64cbba Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 25 Jan 2016 02:40:55 +0000 Subject: add native a_crash primitive for arm the .byte directive encodes a guaranteed-undefined instruction, the same one Linux fills the kuser helper page with when it's disabled. the udf mnemonic and and .insn directives are not supported by old binutils versions, and larger-than-byte integer directives would produce the wrong output on big-endian. --- arch/arm/atomic_arch.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index a52254b2..a74cf3b7 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -62,3 +62,13 @@ static inline void a_barrier() : : : "memory", "cc", "ip", "lr" ); } #endif + +#define a_crash a_crash +static inline void a_crash() +{ + __asm__ __volatile__(".byte 0xf1, 0xde" +#ifndef __thumb__ + ", 0xfd, 0xe7" +#endif + : : : "memory"); +} -- cgit v1.2.1