Skip to content

Commit e73376e

Browse files
committed
Work around warnings in riscv rt
1 parent acf8b06 commit e73376e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

esp-riscv-rt/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern "C" {
5151
/// never returns.
5252
#[link_section = ".init.rust"]
5353
#[export_name = "_start_rust"]
54-
pub unsafe extern "C" fn start_rust(a0: usize, a1: usize, a2: usize) -> ! {
54+
extern "C" fn start_rust(a0: usize, a1: usize, a2: usize) -> ! {
5555
extern "Rust" {
5656
// This symbol will be provided by the user via `#[entry]`
5757
fn main(a0: usize, a1: usize, a2: usize) -> !;
@@ -62,11 +62,13 @@ pub unsafe extern "C" fn start_rust(a0: usize, a1: usize, a2: usize) -> ! {
6262

6363
}
6464

65-
__post_init();
65+
unsafe {
66+
__post_init();
6667

67-
_setup_interrupts();
68+
_setup_interrupts();
6869

69-
main(a0, a1, a2);
70+
main(a0, a1, a2);
71+
}
7072
}
7173

7274
/// Registers saved in trap handler
@@ -118,7 +120,7 @@ pub struct TrapFrame {
118120
/// ExceptionHandler or one of the core interrupt handlers is called.
119121
#[link_section = ".trap.rust"]
120122
#[export_name = "_start_trap_rust"]
121-
pub unsafe extern "C" fn start_trap_rust(trap_frame: *const TrapFrame) {
123+
extern "C" fn start_trap_rust(trap_frame: *const TrapFrame) {
122124
extern "C" {
123125
fn ExceptionHandler(trap_frame: &TrapFrame);
124126
fn DefaultHandler();

0 commit comments

Comments
 (0)