diff --git a/examples/mps3-an536/rust-toolchain.toml b/examples/mps3-an536/rust-toolchain.toml index cc61252..1b7c990 100644 --- a/examples/mps3-an536/rust-toolchain.toml +++ b/examples/mps3-an536/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2025-10-29" +channel = "nightly-2025-12-01" targets = [ "armv8r-none-eabihf", ] diff --git a/examples/mps3-an536/src/bin/abt-exception-a32.rs b/examples/mps3-an536/src/bin/abt-exception-a32.rs index bf430ce..804d679 100644 --- a/examples/mps3-an536/src/bin/abt-exception-a32.rs +++ b/examples/mps3-an536/src/bin/abt-exception-a32.rs @@ -88,7 +88,7 @@ unsafe fn data_abort_handler(addr: usize) -> usize { enable_alignment_check(); // note the fault isn't at the start of the function - let expect_fault_at = unaligned_from_a32 as usize + 8; + let expect_fault_at = unaligned_from_a32 as unsafe extern "C" fn() as usize + 8; if addr == expect_fault_at { println!("caught unaligned_from_a32"); diff --git a/examples/mps3-an536/src/bin/abt-exception-t32.rs b/examples/mps3-an536/src/bin/abt-exception-t32.rs index d2fc682..c399786 100644 --- a/examples/mps3-an536/src/bin/abt-exception-t32.rs +++ b/examples/mps3-an536/src/bin/abt-exception-t32.rs @@ -88,7 +88,7 @@ unsafe fn data_abort_handler(addr: usize) -> usize { enable_alignment_check(); // note the fault isn't at the start of the function - let expect_fault_at = unaligned_from_t32 as usize + 5; + let expect_fault_at = unaligned_from_t32 as unsafe extern "C" fn() as usize + 5; if addr == expect_fault_at { println!("caught unaligned_from_t32"); diff --git a/examples/mps3-an536/src/bin/prefetch-exception-a32.rs b/examples/mps3-an536/src/bin/prefetch-exception-a32.rs index a9e40e6..2f3a59d 100644 --- a/examples/mps3-an536/src/bin/prefetch-exception-a32.rs +++ b/examples/mps3-an536/src/bin/prefetch-exception-a32.rs @@ -63,12 +63,12 @@ unsafe fn prefetch_abort_handler(addr: usize) -> usize { let ifar = Ifar::read(); println!("IFAR (Faulting Address Register): {:?}", ifar); - if addr == bkpt_from_a32 as usize { + if addr == bkpt_from_a32 as unsafe extern "C" fn() as usize { println!("caught bkpt_from_a32"); } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, bkpt_from_a32 as usize + addr, bkpt_from_a32 as unsafe extern "C" fn() as usize ); } diff --git a/examples/mps3-an536/src/bin/prefetch-exception-t32.rs b/examples/mps3-an536/src/bin/prefetch-exception-t32.rs index b5a4ccb..8c96baa 100644 --- a/examples/mps3-an536/src/bin/prefetch-exception-t32.rs +++ b/examples/mps3-an536/src/bin/prefetch-exception-t32.rs @@ -63,7 +63,7 @@ unsafe fn prefetch_abort_handler(addr: usize) -> usize { let ifar = Ifar::read(); println!("IFAR (Faulting Address Register): {:?}", ifar); - if (addr + 1) == bkpt_from_t32 as usize { + if (addr + 1) == bkpt_from_t32 as unsafe extern "C" fn() as usize { // note that thumb functions have their LSB set, despite always being a // multiple of two - that's how the CPU knows they are written in T32 // machine code. @@ -71,7 +71,7 @@ unsafe fn prefetch_abort_handler(addr: usize) -> usize { } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, bkpt_from_t32 as usize + addr, bkpt_from_t32 as unsafe extern "C" fn() as usize ); } diff --git a/examples/mps3-an536/src/bin/undef-exception-a32.rs b/examples/mps3-an536/src/bin/undef-exception-a32.rs index 59c768f..e2bc17b 100644 --- a/examples/mps3-an536/src/bin/undef-exception-a32.rs +++ b/examples/mps3-an536/src/bin/undef-exception-a32.rs @@ -55,12 +55,12 @@ fn prefetch_abort_handler(_addr: usize) -> ! { unsafe fn undefined_handler(addr: usize) -> usize { println!("undefined abort occurred"); - if addr == udf_from_a32 as usize { + if addr == udf_from_a32 as unsafe extern "C" fn() as usize { println!("caught udf_from_a32"); } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, udf_from_a32 as usize + addr, udf_from_a32 as unsafe extern "C" fn() as usize ); } diff --git a/examples/mps3-an536/src/bin/undef-exception-t32.rs b/examples/mps3-an536/src/bin/undef-exception-t32.rs index c6250ea..418b43c 100644 --- a/examples/mps3-an536/src/bin/undef-exception-t32.rs +++ b/examples/mps3-an536/src/bin/undef-exception-t32.rs @@ -55,7 +55,7 @@ fn prefetch_abort_handler(_addr: usize) -> ! { unsafe fn undefined_handler(addr: usize) -> usize { println!("undefined abort occurred"); - if (addr + 1) == udf_from_t32 as usize { + if (addr + 1) == udf_from_t32 as unsafe extern "C" fn() as usize { // note that thumb functions have their LSB set, despite always being a // multiple of two - that's how the CPU knows they are written in T32 // machine code. @@ -63,7 +63,7 @@ unsafe fn undefined_handler(addr: usize) -> usize { } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, udf_from_t32 as usize + addr, udf_from_t32 as unsafe extern "C" fn() as usize ); } diff --git a/examples/versatileab/rust-toolchain.toml b/examples/versatileab/rust-toolchain.toml index e016496..8468b4b 100644 --- a/examples/versatileab/rust-toolchain.toml +++ b/examples/versatileab/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2025-10-29" +channel = "nightly-2025-12-01" targets = [ "armv7r-none-eabi", "armv7r-none-eabihf", diff --git a/examples/versatileab/src/bin/abt-exception-a32.rs b/examples/versatileab/src/bin/abt-exception-a32.rs index e51d621..0745426 100644 --- a/examples/versatileab/src/bin/abt-exception-a32.rs +++ b/examples/versatileab/src/bin/abt-exception-a32.rs @@ -88,7 +88,7 @@ unsafe fn data_abort_handler(addr: usize) -> usize { enable_alignment_check(); // note the fault isn't at the start of the function - let expect_fault_at = unaligned_from_a32 as usize + 8; + let expect_fault_at = unaligned_from_a32 as unsafe extern "C" fn() as usize + 8; if addr == expect_fault_at { println!("caught unaligned_from_a32"); diff --git a/examples/versatileab/src/bin/abt-exception-t32.rs b/examples/versatileab/src/bin/abt-exception-t32.rs index e5c4472..ff263b5 100644 --- a/examples/versatileab/src/bin/abt-exception-t32.rs +++ b/examples/versatileab/src/bin/abt-exception-t32.rs @@ -88,7 +88,7 @@ unsafe fn data_abort_handler(addr: usize) -> usize { enable_alignment_check(); // note the fault isn't at the start of the function - let expect_fault_at = unaligned_from_t32 as usize + 3; + let expect_fault_at = unaligned_from_t32 as unsafe extern "C" fn() as usize + 3; if addr == expect_fault_at { println!("caught unaligned_from_t32"); diff --git a/examples/versatileab/src/bin/prefetch-exception-a32.rs b/examples/versatileab/src/bin/prefetch-exception-a32.rs index 5ca8e11..0dd67aa 100644 --- a/examples/versatileab/src/bin/prefetch-exception-a32.rs +++ b/examples/versatileab/src/bin/prefetch-exception-a32.rs @@ -68,12 +68,12 @@ unsafe fn prefetch_abort_handler(addr: usize) -> usize { let ifar = Ifar::read(); println!("IFAR (Faulting Address Register): {:?}", ifar); - if addr == bkpt_from_a32 as usize { + if addr == bkpt_from_a32 as unsafe extern "C" fn() as usize { println!("caught bkpt_from_a32"); } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, bkpt_from_a32 as usize + addr, bkpt_from_a32 as unsafe extern "C" fn() as usize ); } } diff --git a/examples/versatileab/src/bin/prefetch-exception-t32.rs b/examples/versatileab/src/bin/prefetch-exception-t32.rs index 862490b..ab9631c 100644 --- a/examples/versatileab/src/bin/prefetch-exception-t32.rs +++ b/examples/versatileab/src/bin/prefetch-exception-t32.rs @@ -68,7 +68,7 @@ unsafe fn prefetch_abort_handler(addr: usize) -> usize { let ifar = Ifar::read(); println!("IFAR (Faulting Address Register): {:?}", ifar); - if (addr + 1) == bkpt_from_t32 as usize { + if (addr + 1) == bkpt_from_t32 as unsafe extern "C" fn() as usize { // note that thumb functions have their LSB set, despite always being a // multiple of two - that's how the CPU knows they are written in T32 // machine code. @@ -76,7 +76,7 @@ unsafe fn prefetch_abort_handler(addr: usize) -> usize { } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, bkpt_from_t32 as usize + addr, bkpt_from_t32 as unsafe extern "C" fn() as usize ); } } diff --git a/examples/versatileab/src/bin/undef-exception-a32.rs b/examples/versatileab/src/bin/undef-exception-a32.rs index 0d94975..0b2a398 100644 --- a/examples/versatileab/src/bin/undef-exception-a32.rs +++ b/examples/versatileab/src/bin/undef-exception-a32.rs @@ -55,12 +55,12 @@ fn prefetch_abort_handler(_addr: usize) -> ! { unsafe fn undefined_handler(addr: usize) -> usize { println!("undefined abort occurred"); - if addr == udf_from_a32 as usize { + if addr == udf_from_a32 as unsafe extern "C" fn() as usize { println!("caught udf_from_a32"); } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, udf_from_a32 as usize + addr, udf_from_a32 as unsafe extern "C" fn() as usize ); } diff --git a/examples/versatileab/src/bin/undef-exception-t32.rs b/examples/versatileab/src/bin/undef-exception-t32.rs index 7418cbd..ae0712a 100644 --- a/examples/versatileab/src/bin/undef-exception-t32.rs +++ b/examples/versatileab/src/bin/undef-exception-t32.rs @@ -55,7 +55,7 @@ fn prefetch_abort_handler(_addr: usize) -> ! { unsafe fn undefined_handler(addr: usize) -> usize { println!("undefined abort occurred"); - if (addr + 1) == udf_from_t32 as usize { + if (addr + 1) == udf_from_t32 as unsafe extern "C" fn() as usize { // note that thumb functions have their LSB set, despite always being a // multiple of two - that's how the CPU knows they are written in T32 // machine code. @@ -63,7 +63,7 @@ unsafe fn undefined_handler(addr: usize) -> usize { } else { println!( "Bad fault address {:08x} is not {:08x}", - addr, udf_from_t32 as usize + addr, udf_from_t32 as unsafe extern "C" fn() as usize ); }