Skip to content

Commit

Permalink
Merge pull request tock#3900 from tock/cortex-hardfault-stack
Browse files Browse the repository at this point in the history
Arch: Cortex: Fix stack addresses for kernel hardfault debug message
  • Loading branch information
brghena authored Mar 6, 2024
2 parents a510ac0 + 4b047a7 commit 01918fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions arch/cortex-m/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pub mod systick;

// These constants are defined in the linker script.
extern "C" {
static _estack: *const u32;
static _sstack: *const u32;
static _szero: *const u32;
static _ezero: *const u32;
static _etext: *const u32;
Expand Down
13 changes: 4 additions & 9 deletions arch/cortex-v7m/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ use core::arch::global_asm;

// These constants are defined in the linker script.
extern "C" {
static _estack: *const u32;
static _sstack: *const u32;
static _szero: *const u32;
static _ezero: *const u32;
static _etext: *const u32;
static _srelocate: *const u32;
static _erelocate: *const u32;
static _estack: u8;
static _sstack: u8;
}

#[cfg(all(target_arch = "arm", target_os = "none"))]
Expand Down Expand Up @@ -407,8 +402,8 @@ unsafe extern "C" fn hard_fault_handler_arm_v7m_kernel(
exception_number,
ipsr_isr_number_to_str(exception_number),
faulting_stack as u32,
_estack as u32,
_sstack as u32,
core::ptr::addr_of!(_estack) as u32,
core::ptr::addr_of!(_sstack) as u32,
shcsr,
cfsr,
hfsr,
Expand Down

0 comments on commit 01918fa

Please sign in to comment.