Skip to content

Commit

Permalink
boot: Remove impl of Info for Linux Boot Protocol
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rbradford committed Mar 10, 2023
1 parent 2c51237 commit 734c632
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use core::mem;

use crate::{
bootinfo::{EntryType, Info, MemoryEntry},
common,
fat::{Error, Read},
mem::MemoryRegion,
};
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 734c632

Please sign in to comment.