-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from peterfang/dev-tdp-stage2
stage2: add TD Partitioning support
- Loading branch information
Showing
11 changed files
with
168 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,9 @@ | |
// Author: Joerg Roedel <[email protected]> | ||
|
||
use crate::address::{PhysAddr, VirtAddr}; | ||
use crate::mm::pagetable::{PageFrame, PageTable}; | ||
use crate::utils::immut_after_init::ImmutAfterInitCell; | ||
|
||
#[cfg(target_os = "none")] | ||
use crate::mm::pagetable::PageTable; | ||
|
||
#[derive(Debug, Copy, Clone)] | ||
#[allow(dead_code)] | ||
pub struct FixedAddressMappingRange { | ||
|
@@ -67,7 +65,16 @@ pub fn init_kernel_mapping_info( | |
|
||
#[cfg(target_os = "none")] | ||
pub fn virt_to_phys(vaddr: VirtAddr) -> PhysAddr { | ||
match PageTable::virt_to_phys(vaddr) { | ||
match PageTable::virt_to_frame(vaddr) { | ||
Some(paddr) => paddr.address(), | ||
None => { | ||
panic!("Invalid virtual address {:#018x}", vaddr); | ||
} | ||
} | ||
} | ||
|
||
pub fn virt_to_frame(vaddr: VirtAddr) -> PageFrame { | ||
match PageTable::virt_to_frame(vaddr) { | ||
Some(paddr) => paddr, | ||
None => { | ||
panic!("Invalid virtual address {:#018x}", vaddr); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters