Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/el2_hello.rs",
line: 27,
line: 28,
column: 5,
},
can_unwind: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/mps3-an536/reference/hello-armv8r-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 20,
column: 5,
},
can_unwind: true,
Expand Down
10 changes: 0 additions & 10 deletions examples/mps3-an536/reference/svc-a32-armv8r-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 21,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/mps3-an536/reference/svc-t32-armv8r-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
1 change: 1 addition & 0 deletions examples/mps3-an536/src/bin/el2_hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fn main() -> ! {
}
}

mps3_an536::want_panic();
panic!("I am an example panic");
}

Expand Down
4 changes: 3 additions & 1 deletion examples/mps3-an536/src/bin/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#![no_main]

use aarch32_rt::entry;
use mps3_an536 as _;
use semihosting::println;

use mps3_an536 as _;

/// The entry-point to the Rust application.
///
/// It is called by the start-up code in `aarch32-rt`.
Expand All @@ -15,5 +16,6 @@ fn main() -> ! {
let x = 1.0f64;
let y = x * 2.0;
println!("Hello, this is semihosting! x = {:0.3}, y = {:0.3}", x, y);
mps3_an536::want_panic();
panic!("I am an example panic");
}
2 changes: 1 addition & 1 deletion examples/mps3-an536/src/bin/svc-a32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() -> ! {
println!("x = {}, y = {}, z = {:0.3}", x, y, z);
aarch32_cpu::svc!(0xABCDEF);
println!("x = {}, y = {}, z = {:0.3}", x, y, z);
panic!("I am an example panic");
semihosting::process::exit(0);
}

/// This is our SVC exception handler
Expand Down
2 changes: 1 addition & 1 deletion examples/mps3-an536/src/bin/svc-t32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() -> ! {
svc12_from_t32();
}
println!("x = {}, y = {}, z = {:0.3}", x, y, z);
panic!("I am an example panic");
semihosting::process::exit(0);
}

/// This is our SVC exception handler
Expand Down
13 changes: 12 additions & 1 deletion examples/mps3-an536/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub const VIRTUAL_TIMER_PPI: arm_gic::IntId = arm_gic::IntId::ppi(11);
#[cfg(not(arm_architecture = "v8-r"))]
compile_error!("This example is only compatible to the ARMv8-R architecture");

static WANT_PANIC: AtomicBool = AtomicBool::new(false);

/// Called when the application raises an unrecoverable `panic!`.
///
/// Prints the panic to the console and then exits QEMU using a semihosting
Expand All @@ -72,7 +74,16 @@ compile_error!("This example is only compatible to the ARMv8-R architecture");
#[cfg(target_os = "none")]
fn panic(info: &core::panic::PanicInfo) -> ! {
semihosting::println!("PANIC: {:#?}", info);
semihosting::process::abort();
if WANT_PANIC.load(Ordering::Relaxed) {
semihosting::process::exit(0);
} else {
semihosting::process::abort();
}
}

/// Set the panic function as no longer returning a failure code via semihosting
pub fn want_panic() {
WANT_PANIC.store(true, Ordering::Relaxed);
}

#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion examples/versatileab/reference/hello-armv4t-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/versatileab/reference/hello-armv5te-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/versatileab/reference/hello-armv7a-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/versatileab/reference/hello-armv7r-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/hello.rs",
line: 18,
line: 19,
column: 5,
},
can_unwind: true,
Expand Down
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-armv4t-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-armv5te-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-armv7a-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-armv7a-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-armv7r-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-armv7r-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-thumbv4t-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-a32-thumbv5te-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0xabcdef
In svc_handler, with arg=0x456789
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-a32.rs",
line: 22,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-armv4t-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-armv5te-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-armv7a-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-armv7a-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-armv7r-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-armv7r-none-eabihf.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
10 changes: 0 additions & 10 deletions examples/versatileab/reference/svc-t32-thumbv4t-none-eabi.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ x = 1, y = 2, z = 3.000
In svc_handler, with arg=0x000012
In svc_handler, with arg=0x000034
x = 1, y = 2, z = 3.000
PANIC: PanicInfo {
message: I am an example panic,
location: Location {
file: "src/bin/svc-t32.rs",
line: 23,
column: 5,
},
can_unwind: true,
force_no_backtrace: false,
}
Loading