From 734c632be2869a25cf7a67499e2d43c43aa88409 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 10 Mar 2023 12:44:38 +0000 Subject: [PATCH] boot: Remove impl of Info for Linux Boot Protocol The Linux Boot Protocol is no longer supported for starting RHF and as such there is no need to implemement that trait. In this case the trait was also being overloaded for access to some code for booting *with* the Linux Boot Protocol and so those functions are now directly included in `boot::Params`. Signed-off-by: Rob Bradford --- src/boot.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/boot.rs b/src/boot.rs index 379524e2..6adbe4fa 100644 --- a/src/boot.rs +++ b/src/boot.rs @@ -5,7 +5,6 @@ use core::mem; use crate::{ bootinfo::{EntryType, Info, MemoryEntry}, - common, fat::{Error, Read}, mem::MemoryRegion, }; @@ -131,22 +130,12 @@ impl Params { self.e820_table[i as usize] = info.entry(i as usize).into(); } } -} -impl Info for Params { - fn name(&self) -> &str { - "Linux Boot Protocol" - } - fn rsdp_addr(&self) -> u64 { - self.acpi_rsdp_addr - } - fn cmdline(&self) -> &[u8] { - unsafe { common::from_cstring(self.hdr.cmd_line_ptr as u64) } - } - fn num_entries(&self) -> usize { + pub fn num_entries(&self) -> usize { self.e820_entries as usize } - fn entry(&self, idx: usize) -> MemoryEntry { + + pub fn entry(&self, idx: usize) -> MemoryEntry { assert!(idx < self.num_entries()); let entry = self.e820_table[idx]; MemoryEntry::from(entry)