From 96fbd8961ef748b0516f1ebd55ff73f150d0e3f7 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 25 Jul 2018 19:48:44 -0500 Subject: [PATCH] cmsis: add __BKPT --- coresimd/arm/cmsis.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/coresimd/arm/cmsis.rs b/coresimd/arm/cmsis.rs index e1913df67d..555ab77dc6 100644 --- a/coresimd/arm/cmsis.rs +++ b/coresimd/arm/cmsis.rs @@ -327,3 +327,14 @@ pub unsafe fn __DSB() { pub unsafe fn __DMB() { asm!("dmb 0xF" : : : "memory" : "volatile"); } + +/// Breakpoint +/// +/// Causes the processor to enter Debug state. Debug tools can use this to investigate system state +/// when the instruction at a particular address is reached. +#[inline] +#[target_feature(enable = "mclass")] +#[cfg_attr(test, assert_instr(bkpt))] +pub unsafe fn __BKPT(value: u8) { + asm!("bkpt $0" : : "i"(value) : : "volatile") +}