diff options
author | Rich Felker <dalias@aerifal.cx> | 2016-01-25 02:40:55 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-01-25 02:44:56 +0000 |
commit | 89e149d275a7699a4a5e4c98bab267648f64cbba (patch) | |
tree | f1b30d37f117c9059745bb57b26e2f3b345405c5 /arch/arm | |
parent | 2c9acc51cdf40871625405a7e4a766cccb77ab6f (diff) | |
download | musl-89e149d275a7699a4a5e4c98bab267648f64cbba.tar.gz musl-89e149d275a7699a4a5e4c98bab267648f64cbba.tar.bz2 musl-89e149d275a7699a4a5e4c98bab267648f64cbba.tar.xz musl-89e149d275a7699a4a5e4c98bab267648f64cbba.zip |
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.
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/atomic_arch.h | 10 |
1 files changed, 10 insertions, 0 deletions
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"); +} |