clippy and reformat

This commit is contained in:
Erin 2023-01-07 22:18:47 +01:00 committed by ondra05
parent 7d21956b0a
commit d3d52c974a
3 changed files with 7 additions and 9 deletions

View file

@ -148,7 +148,7 @@ impl Heap {
aligned_first_chunk + chunks_needed <= first_chunk + chunks_needed + chunk_alignment
);
let header: *mut Header = unsafe { mem::transmute(addr) };
let header = add as *mut Header;
unsafe {
(*header).size_in_chunks = chunks_needed;
}
@ -340,5 +340,5 @@ unsafe impl Send for Heap {}
#[alloc_error_handler]
fn alloc_error_handler(layout: alloc::alloc::Layout) -> ! {
loop {}
crate::arch::sloop()
}

View file

@ -13,15 +13,11 @@ static SERIAL_CONSOLE: Mutex<SerialPort> = Mutex::new(unsafe { SerialPort::new(0
#[no_mangle]
unsafe extern "C" fn _kernel_start() -> ! {
static HDHM_REQ: LimineHhdmRequest = LimineHhdmRequest::new(0);
static MMAP_REQ: LimineMmapRequest = LimineMmapRequest::new(0);
static KFILE_REQ: LimineKernelFileRequest = LimineKernelFileRequest::new(0);
static MOD_REQ: LimineModuleRequest = LimineModuleRequest::new(0);
SERIAL_CONSOLE.lock().init();
crate::logger::init().expect("failed to set logger");
log::info!("Initialising AKern {}", crate::VERSION);
static HDHM_REQ: LimineHhdmRequest = LimineHhdmRequest::new(0);
memory::init_pt(VirtAddr::new(
HDHM_REQ
.get_response()
@ -30,6 +26,7 @@ unsafe extern "C" fn _kernel_start() -> ! {
.offset,
));
static MMAP_REQ: LimineMmapRequest = LimineMmapRequest::new(0);
memory::init_falloc(
MMAP_REQ
.get_response()
@ -42,6 +39,8 @@ unsafe extern "C" fn _kernel_start() -> ! {
gdt::init();
interrupts::init();
static KFILE_REQ: LimineKernelFileRequest = LimineKernelFileRequest::new(0);
static MOD_REQ: LimineModuleRequest = LimineModuleRequest::new(0);
crate::kmain::kmain(
KFILE_REQ
.get_response()

View file

@ -1,7 +1,6 @@
use error_stack::{bail, report, Context, IntoReport, Result, ResultExt};
use fatfs::{FileSystem, FormatVolumeOptions, FsOptions, ReadWriteSeek};
use nix::fcntl::FallocateFlags;
use std::{fmt::Display, fs::File, io, os::fd::AsRawFd, path::Path, process::Command};
use std::{fmt::Display, fs::File, io, path::Path, process::Command};
fn main() -> Result<(), Error> {
env_logger::init();