浏览代码

Merge branch 'master' into master

Rob Gries 6 年之前
父节点
当前提交
dee1a4680e
共有 3 个文件被更改,包括 9 次插入7 次删除
  1. 1 1
      Cargo.toml
  2. 6 6
      src/memory_map.rs
  3. 2 0
      src/rsdp.rs

+ 1 - 1
Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "multiboot2"
-version = "0.6.0"
+version = "0.7.1"
 authors = ["Philipp Oppermann <dev@phil-opp.com>", "Calvin Lee <cyrus296@gmail.com>"]
 license = "MIT/Apache-2.0"
 description = "An experimental Multiboot 2 crate for ELF-64/32 kernels."

+ 6 - 6
src/memory_map.rs

@@ -30,16 +30,16 @@ pub struct MemoryArea {
 }
 
 impl MemoryArea {
-    pub fn start_address(&self) -> usize {
-        self.base_addr as usize
+    pub fn start_address(&self) -> u64 {
+        self.base_addr
     }
 
-    pub fn end_address(&self) -> usize {
-        (self.base_addr + self.length) as usize
+    pub fn end_address(&self) -> u64 {
+        (self.base_addr + self.length)
     }
 
-    pub fn size(&self) -> usize {
-        self.length as usize
+    pub fn size(&self) -> u64 {
+        self.length
     }
 }
 

+ 2 - 0
src/rsdp.rs

@@ -37,6 +37,7 @@ impl RsdpV1Tag {
         self.revision
     }
 
+    /// Get the physical address of the RSDT.
     pub fn rsdt_address(&self) -> usize {
         self.rsdt_address as usize
     }
@@ -75,6 +76,7 @@ impl RsdpV2Tag {
         self.revision
     }
 
+    /// Get the physical address of the XSDT. On x86, this is truncated from 64-bit to 32-bit.
     pub fn xsdt_address(&self) -> usize {
         self.xsdt_address as usize
     }