aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/src
diff options
context:
space:
mode:
authorGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-08-23 21:59:01 +0200
committerGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-08-23 21:59:01 +0200
commitac74bff1e91b1042a906343e30cb685754fb6c82 (patch)
treee0820bce9f9202260470892277fa06453ad61c07 /cortex-m-rt/src
parent679d42223fe79759bc634675694c46ae8ba0ce62 (diff)
downloadcortex-m-ac74bff1e91b1042a906343e30cb685754fb6c82.tar.gz
cortex-m-ac74bff1e91b1042a906343e30cb685754fb6c82.tar.zst
cortex-m-ac74bff1e91b1042a906343e30cb685754fb6c82.zip
Revert "Changed Hardfault's and DefaultHander's default implementations to panic"
This reverts commit ffffb7b3aaef1d9bb4e4b81347ed8f1d50e50ea4.
Diffstat (limited to 'cortex-m-rt/src')
-rw-r--r--cortex-m-rt/src/lib.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs
index fe4ee20..335a357 100644
--- a/cortex-m-rt/src/lib.rs
+++ b/cortex-m-rt/src/lib.rs
@@ -199,15 +199,14 @@
//! won't find it.
//!
//! - `DefaultHandler`. This is the default handler. If not overridden using `#[exception] fn
-//! DefaultHandler(..` this will cause a panic with the message "DefaultHandler #`i`", where `i` is
-//! the number of the interrupt handler.
+//! DefaultHandler(..` this will be an infinite loop.
//!
//! - `HardFaultTrampoline`. This is the real hard fault handler. This function is simply a
//! trampoline that jumps into the user defined hard fault handler named `HardFault`. The
//! trampoline is required to set up the pointer to the stacked exception frame.
//!
//! - `HardFault`. This is the user defined hard fault handler. If not overridden using
-//! `#[exception] fn HardFault(..` it will default to a panic with message "HardFault".
+//! `#[exception] fn HardFault(..` it will default to an infinite loop.
//!
//! - `__STACK_START`. This is the first entry in the `.vector_table` section. This symbol contains
//! the initial value of the stack pointer; this is where the stack will be located -- the stack
@@ -442,6 +441,7 @@ extern crate cortex_m_rt_macros as macros;
extern crate r0;
use core::fmt;
+use core::sync::atomic::{self, Ordering};
/// Attribute to declare an interrupt (AKA device-specific exception) handler
///
@@ -990,17 +990,21 @@ pub unsafe extern "C" fn Reset() -> ! {
#[link_section = ".HardFault.default"]
#[no_mangle]
pub unsafe extern "C" fn HardFault_(ef: &ExceptionFrame) -> ! {
- panic!("HardFault");
+ loop {
+ // add some side effect to prevent this from turning into a UDF instruction
+ // see rust-lang/rust#28728 for details
+ atomic::compiler_fence(Ordering::SeqCst);
+ }
}
#[doc(hidden)]
#[no_mangle]
pub unsafe extern "C" fn DefaultHandler_() -> ! {
- const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32;
-
- let irqn = core::ptr::read(SCB_ICSR) as u8 as i16 - 16;
-
- panic!("DefaultHandler #{}", irqn);
+ loop {
+ // add some side effect to prevent this from turning into a UDF instruction
+ // see rust-lang/rust#28728 for details
+ atomic::compiler_fence(Ordering::SeqCst);
+ }
}
#[doc(hidden)]
> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/path.ts (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-17Add JSC.WeakGravatar Jarred Sumner 2-0/+293
2023-10-15more microtasksGravatar Jarred Sumner 1-11/+5
2023-10-15It's starting to workGravatar Jarred Sumner 6-49/+89
2023-10-15Things can happenGravatar Jarred Sumner 9-53/+150
2023-10-15FurtherGravatar Jarred Sumner 1-20/+30
2023-10-15The startup message sends successfullyGravatar Jarred Sumner 4-96/+130
2023-10-15it compiledGravatar Jarred Sumner 2-158/+238
2023-10-15okay we are starting to try itGravatar Jarred Sumner 4-9/+43
2023-10-15Okay most of the code is writtenGravatar Jarred Sumner 3-29/+398
2023-10-14MoreGravatar Jarred Sumner 7-66/+504
2023-10-14wipGravatar Jarred Sumner 8-16/+1194
2023-10-14More progressGravatar Jarred Sumner 4-36/+405
2023-10-13wipGravatar Jarred Sumner 8-48/+308