Skip to content

Commit

Permalink
Fix all warnings, lints, etc
Browse files Browse the repository at this point in the history
Signed-off-by: Graham MacDonald <[email protected]>
  • Loading branch information
gmacd committed Aug 3, 2024
1 parent 6df7672 commit 63ea90c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions aarch64/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::kmem::heap_virtrange;
use crate::mailbox;
use crate::pagealloc;
use crate::registers;
use crate::runtime;
use crate::trap;
use crate::vm;
use crate::vm::kernel_root;
Expand Down Expand Up @@ -81,6 +80,11 @@ fn print_board_info() {
println!(" Firmware Rev:\t{fw_revision:#010x}");
}

fn enable_bump_allocator() {
#[cfg(not(test))]
crate::runtime::enable_bump_allocator();
}

/// This function is concerned with preparing the system to the point where an
/// allocator can be set up and allocation is available. We can't assume
/// there's any allocator available when executing this function.
Expand Down Expand Up @@ -118,7 +122,7 @@ pub fn init(dtb_va: usize) {
// bump allocator that makes permanent allocations. This can be used to
// create the more complex vmem allocator. Once the vmem allocator is
// available, we switch to that.
runtime::enable_bump_allocator();
enable_bump_allocator();

vmalloc::init(heap_virtrange());
//runtime::enable_vmem_allocator();
Expand Down
3 changes: 1 addition & 2 deletions aarch64/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ mod mailbox;
mod pagealloc;
mod param;
mod registers;
mod runtime;
mod trap;
mod uartmini;
mod uartpl011;
Expand All @@ -42,5 +43,3 @@ core::arch::global_asm!(include_str!("l.S"));
pub extern "C" fn main9(dtb_va: usize) {
init(dtb_va);
}

mod runtime;
5 changes: 5 additions & 0 deletions riscv64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ port = { path = "../port" }

[features]
opensbi = []

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(platform, values("nezha", "virt"))',
] }
1 change: 0 additions & 1 deletion riscv64/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(alloc_error_handler)]
#![feature(asm_const)]
#![feature(panic_info_message)]
#![cfg_attr(not(any(test)), no_std)]
#![cfg_attr(not(test), no_main)]
#![allow(clippy::upper_case_acronyms)]
Expand Down
2 changes: 1 addition & 1 deletion riscv64/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern "C" fn eh_personality() {}
fn panic(info: &PanicInfo) -> ! {
print!("Panic: ");
if let Some(p) = info.location() {
println!("line {}, file {}: {}", p.line(), p.file(), info.message().unwrap());
println!("line {}, file {}: {}", p.line(), p.file(), info.message());
} else {
println!("no information available.");
}
Expand Down

0 comments on commit 63ea90c

Please sign in to comment.