Browse Source

Remove lang_items

Vadim Kaushan 6 years ago
parent
commit
52a8809fa1
2 changed files with 0 additions and 56 deletions
  1. 0 53
      riscv-rt/src/lang_items.rs
  2. 0 3
      riscv-rt/src/lib.rs

+ 0 - 53
riscv-rt/src/lang_items.rs

@@ -1,53 +0,0 @@
-// NOTE: Adapted from cortex-m/src/lang_items.rs
-
-use riscv::asm;
-
-/// Default panic handler
-#[panic_handler]
-fn panic(_info: &core::panic::PanicInfo) -> ! {
-    asm::ebreak();
-    loop {}
-}
-
-/// Lang item required to make the normal `main` work in applications
-// This is how the `start` lang item works:
-// When `rustc` compiles a binary crate, it creates a `main` function that looks
-// like this:
-//
-// ```
-// #[export_name = "main"]
-// pub extern "C" fn rustc_main(argc: isize, argv: *const *const u8) -> isize {
-//     start(main)
-// }
-// ```
-//
-// Where `start` is this function and `main` is the binary crate's `main`
-// function.
-//
-// The final piece is that the entry point of our program, the reset handler,
-// has to call `rustc_main`. That's covered by the `reset_handler` function in
-// root of this crate.
-#[lang = "start"]
-extern "C" fn lang_start<T>(
-    main: fn(),
-    _argc: isize,
-    _argv: *const *const u8,
-) -> isize
-    where
-    T: Termination,
-{
-    main();
-
-    0
-}
-
-#[lang = "termination"]
-pub trait Termination {
-    fn report(self) -> i32;
-}
-
-impl Termination for () {
-    fn report(self) -> i32 {
-        0
-    }
-}

+ 0 - 3
riscv-rt/src/lib.rs

@@ -168,14 +168,11 @@
 #![feature(compiler_builtins_lib)]
 #![feature(const_fn)]
 #![feature(global_asm)]
-#![feature(lang_items)]
 #![feature(linkage)]
 
 extern crate riscv;
 extern crate r0;
 
-mod lang_items;
-
 use riscv::register::{mcause, mstatus, mtvec};
 
 extern "C" {