-
Notifications
You must be signed in to change notification settings - Fork 45
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 #15 from fortanix/raoul/interface
Refactoring system interface
- Loading branch information
Showing
11 changed files
with
319 additions
and
310 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use core::ptr; | ||
use Allocator; | ||
|
||
pub struct System { | ||
_priv: (), | ||
} | ||
|
||
impl System { | ||
const fn new() -> System { | ||
System { _priv: () } | ||
} | ||
} | ||
|
||
unsafe impl Allocator for System { | ||
fn alloc(&self, size: usize) -> (*mut u8, usize, u32) { | ||
(ptr::null_mut(), 0, 0) | ||
} | ||
|
||
fn remap(&self, ptr: *mut u8, oldsize: usize, newsize: usize, can_move: bool) -> *mut u8 { | ||
ptr::null_mut() | ||
} | ||
|
||
fn free_part(&self, ptr: *mut u8, oldsize: usize, newsize: usize) -> bool { | ||
false | ||
} | ||
|
||
fn free(&self, ptr: *mut u8, size: usize) -> bool { | ||
false | ||
} | ||
|
||
fn can_release_part(&self, flags: u32) -> bool { | ||
false | ||
} | ||
|
||
fn allocates_zeros(&self) -> bool { | ||
false | ||
} | ||
|
||
fn page_size(&self) -> usize { | ||
1 | ||
} | ||
} |
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
Oops, something went wrong.