forked from theseus-os/Theseus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
PageSize
trait for defining 4K, 2M, and 1G huge pages (theseus-…
…os#1031) * All chunk-related types are now parameterized with a `P: PageSize` type parameter: * `Page` and `Frame`, which ensure that the underlying virtual or physical address is always properly aligned to the specified size. * `PageRange` and `FrameRange`, which ensure that the range of pages or frames are correctly aligned and only can be created in granular chunks of the given `PageSize`. * When iterating over a range of huge pages or frames, each step will be at the granularity of one huge page, which makes it easy to iterate of huge pages and huge frames in lockstep. * There are various implementations of the conversion traits `From` and `TryFrom` for normal and huge pages/frames and ranges. * The `PageSize` parameter can only be one of 3 marker structs: 1. `Page4K`: a normal 4KiB page (P1-level), which is the default. 2. `Page2M`: a P2-level huge page. 3. `Page1G`: a P3-level huge page. * This is only relevant to x86_64 at the moment, though we may add aarch64 huge page sizes in the future too. Co-authored-by: Kevin Boos <[email protected]> b521678
- Loading branch information
Showing
101 changed files
with
1,139 additions
and
471 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
Oops, something went wrong.