Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
rv32i: remove abort function
This potentially dangerous function is not referenced anywhere and
hence can be removed, reducing the amount of unsafe code.
  • Loading branch information
lschuermann authored and bradjc committed Feb 4, 2021
commit 9aa145d2a8887fd9fc9250418d6315d1eef1c7cd
17 changes: 0 additions & 17 deletions arch/rv32i/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,23 +384,6 @@ pub extern "C" fn _start_trap() {
}
}

/// Ensure an abort symbol exists.
#[cfg(all(target_arch = "riscv32", target_os = "none"))]
#[link_section = ".init"]
#[export_name = "abort"]
pub extern "C" fn abort() {
unsafe {
llvm_asm! ("
// Simply go back to the start as if we had just booted.
j _start
"
:
:
:
: "volatile");
}
}

/// Print a readable string for an mcause reason.
pub unsafe fn print_mcause(mcval: csr::mcause::Trap, writer: &mut dyn Write) {
match mcval {
Expand Down