[pvmfw] Move exception name out of print_exception_failure()
Bug: 284462758
Test: m pvmfw_img
Change-Id: Ic4681d6949314f2978ad53eef305ad266489c72d
diff --git a/pvmfw/src/exceptions.rs b/pvmfw/src/exceptions.rs
index 430b524..797138c 100644
--- a/pvmfw/src/exceptions.rs
+++ b/pvmfw/src/exceptions.rs
@@ -116,11 +116,17 @@
/// Prints the details of an exception failure, excluding UART exceptions.
#[inline]
-fn print_exception_failure(esr: Esr, far: usize, elr: u64, e: HandleExceptionError) {
+fn print_exception_failure(
+ esr: Esr,
+ far: usize,
+ elr: u64,
+ e: HandleExceptionError,
+ exception_name: &str,
+) {
let is_uart_exception = esr == Esr::DataAbortSyncExternalAbort && page_4kb_of(far) == UART_PAGE;
// Don't print to the UART if we are handling an exception it could raise.
if !is_uart_exception {
- eprintln!("sync_exception_current");
+ eprintln!("{exception_name}");
eprintln!("{e}");
eprintln!("{esr}, far={far:#08x}, elr={elr:#08x}");
}
@@ -134,7 +140,7 @@
let far = read_sysreg!("far_el1");
if let Err(e) = handle_exception(esr, far) {
- print_exception_failure(esr, far, elr, e);
+ print_exception_failure(esr, far, elr, e, "sync_exception_current");
reboot()
}
}