-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm/vm/mapping: replace Box with GlobalBox
Replace uses of Box in the mapping API with the new fallible-allocation-aware GlobalBox type. Signed-off-by: Carlos López <[email protected]>
- Loading branch information
Showing
8 changed files
with
25 additions
and
22 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
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,6 +5,7 @@ | |
// Author: Joerg Roedel <[email protected]> | ||
|
||
use crate::address::{Address, PhysAddr}; | ||
use crate::error::SvsmError; | ||
use crate::mm::pagetable::PTEntryFlags; | ||
|
||
use super::{Mapping, VirtualMapping}; | ||
|
@@ -51,7 +52,7 @@ impl VMPhysMem { | |
/// # Returns | ||
/// | ||
/// New [`Mapping`] containing [`VMPhysMem`] | ||
pub fn new_mapping(base: PhysAddr, size: usize, writable: bool) -> Mapping { | ||
pub fn new_mapping(base: PhysAddr, size: usize, writable: bool) -> Result<Mapping, SvsmError> { | ||
Mapping::new(Self::new(base, size, writable)) | ||
} | ||
} | ||
|
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,6 +5,7 @@ | |
// Author: Joerg Roedel <[email protected]> | ||
|
||
use crate::address::PhysAddr; | ||
use crate::error::SvsmError; | ||
use crate::mm::pagetable::PTEntryFlags; | ||
|
||
use super::{Mapping, VirtualMapping}; | ||
|
@@ -41,7 +42,7 @@ impl VMReserved { | |
/// # Returns | ||
/// | ||
/// New Mapping of VMReserved | ||
pub fn new_mapping(size: usize) -> Mapping { | ||
pub fn new_mapping(size: usize) -> Result<Mapping, SvsmError> { | ||
Mapping::new(Self::new(size)) | ||
} | ||
} | ||
|
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