Skip to content

Commit

Permalink
Add PageSize trait for defining 4K, 2M, and 1G huge pages (#1031)
Browse files Browse the repository at this point in the history
* 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 <kevinaboos@gmail.com> b521678
  • Loading branch information
kevinaboos committed Sep 8, 2023
1 parent 5de443a commit 05960af
Show file tree
Hide file tree
Showing 83 changed files with 1,075 additions and 411 deletions.
11 changes: 6 additions & 5 deletions doc/frame_allocator/struct.AllocatedFrame.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions doc/frame_allocator/struct.Frames.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions doc/frame_allocator/struct.PhysicalMemoryRegion.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/implementors/core/borrow/trait.Borrow.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion doc/implementors/core/clone/trait.Clone.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/implementors/core/cmp/trait.Eq.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion doc/implementors/core/cmp/trait.Ord.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 05960af

Please sign in to comment.