Jelajahi Sumber

Rename rsdp_search to rsdp, add fields for publishing

Isaac Woods 4 tahun lalu
induk
melakukan
3f9887324f
6 mengubah file dengan 19 tambahan dan 14 penghapusan
  1. 1 1
      acpi/Cargo.toml
  2. 2 2
      acpi/src/lib.rs
  3. 13 0
      rsdp/Cargo.toml
  4. 1 1
      rsdp/src/handler.rs
  5. 2 2
      rsdp/src/lib.rs
  6. 0 8
      rsdp_search/Cargo.toml

+ 1 - 1
acpi/Cargo.toml

@@ -12,4 +12,4 @@ edition = "2018"
 [dependencies]
 log = "0.4"
 bit_field = "0.10"
-rsdp_search = { path = "../rsdp_search" }
+rsdp = { path = "../rsdp" }

+ 2 - 2
acpi/src/lib.rs

@@ -56,7 +56,7 @@ pub use crate::{
     mcfg::PciConfigRegions,
     platform::{InterruptModel, PlatformInfo},
 };
-pub use rsdp_search::{
+pub use rsdp::{
     handler::{AcpiHandler, PhysicalMapping},
     RsdpError,
 };
@@ -65,7 +65,7 @@ use crate::sdt::{SdtHeader, Signature};
 use alloc::{collections::BTreeMap, vec::Vec};
 use core::mem;
 use log::trace;
-use rsdp_search::Rsdp;
+use rsdp::Rsdp;
 
 #[derive(Debug)]
 pub enum AcpiError {

+ 13 - 0
rsdp/Cargo.toml

@@ -0,0 +1,13 @@
+[package]
+name = "rsdp"
+version = "0.1.0"
+authors = ["Isaac Woods", "Restioson"]
+repository = "https://github.com/rust-osdev/acpi"
+description = "Zero-allocation library for locating and parsing the RSDP, the first ACPI table"
+categories = ["hardware-support", "no-std"]
+readme = "../README.md"
+license = "MIT/Apache-2.0"
+edition = "2018"
+
+[dependencies]
+log = "0.4"

+ 1 - 1
rsdp_search/src/handler.rs → rsdp/src/handler.rs

@@ -39,7 +39,7 @@ where
 /// however you please, as long as they conform to the documentation of each function. The handler is stored in
 /// every `PhysicalMapping` so it's able to unmap itself when dropped, so this type needs to be something you can
 /// clone/move about freely (e.g. a reference, wrapper over `Rc`, marker struct, etc.).
-pub trait AcpiHandler: Sized {
+pub trait AcpiHandler: Clone + Sized {
     /// Given a physical address and a size, map a region of physical memory that contains `T` (note: the passed
     /// size may be larger than `size_of::<T>()`). The address is not neccessarily page-aligned, so the
     /// implementation may need to map more than `size` bytes. The virtual address the region is mapped to does not

+ 2 - 2
rsdp_search/src/lib.rs → rsdp/src/lib.rs

@@ -71,7 +71,7 @@ impl Rsdp {
     where
         H: AcpiHandler,
     {
-        let areas = find_search_areas(&handler);
+        let areas = find_search_areas(handler.clone());
 
         /*
          * We map a page at a time, as mapping the entire areas puts a lot of burden on a naive paging
@@ -175,7 +175,7 @@ impl Rsdp {
 }
 
 /// Find the areas we should search for the RSDP in.
-pub fn find_search_areas<H>(handler: &H) -> [RangeInclusive<usize>; 2]
+pub fn find_search_areas<H>(handler: H) -> [RangeInclusive<usize>; 2]
 where
     H: AcpiHandler,
 {

+ 0 - 8
rsdp_search/Cargo.toml

@@ -1,8 +0,0 @@
-[package]
-name = "rsdp_search"
-version = "0.1.0"
-authors = ["Isaac Woods", "Restioson"]
-edition = "2018"
-
-[dependencies]
-log = "0.4"