Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
josephlr committed Feb 10, 2024
2 parents 1745184 + f1cb4a0 commit 9afa8e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:

- name: Cache binaries
id: cache-bin
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: binaries
key: ${{ runner.OS }}-binaries
Expand Down
24 changes: 9 additions & 15 deletions src/structures/paging/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,9 @@ impl Page<Size1GiB> {
p4_index: PageTableIndex,
p3_index: PageTableIndex,
) -> Self {
use bit_field::BitField;

let mut addr = 0;
addr.set_bits(39..48, u64::from(p4_index));
addr.set_bits(30..39, u64::from(p3_index));
addr |= u64::from(p4_index) << 39;
addr |= u64::from(p3_index) << 30;
Page::containing_address(VirtAddr::new_truncate(addr))
}
}
Expand All @@ -206,12 +204,10 @@ impl Page<Size2MiB> {
p3_index: PageTableIndex,
p2_index: PageTableIndex,
) -> Self {
use bit_field::BitField;

let mut addr = 0;
addr.set_bits(39..48, u64::from(p4_index));
addr.set_bits(30..39, u64::from(p3_index));
addr.set_bits(21..30, u64::from(p2_index));
addr |= u64::from(p4_index) << 39;
addr |= u64::from(p3_index) << 30;
addr |= u64::from(p2_index) << 21;
Page::containing_address(VirtAddr::new_truncate(addr))
}
}
Expand All @@ -225,13 +221,11 @@ impl Page<Size4KiB> {
p2_index: PageTableIndex,
p1_index: PageTableIndex,
) -> Self {
use bit_field::BitField;

let mut addr = 0;
addr.set_bits(39..48, u64::from(p4_index));
addr.set_bits(30..39, u64::from(p3_index));
addr.set_bits(21..30, u64::from(p2_index));
addr.set_bits(12..21, u64::from(p1_index));
addr |= u64::from(p4_index) << 39;
addr |= u64::from(p3_index) << 30;
addr |= u64::from(p2_index) << 21;
addr |= u64::from(p1_index) << 12;
Page::containing_address(VirtAddr::new_truncate(addr))
}

Expand Down
2 changes: 1 addition & 1 deletion testing/x86_64-bare-metal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",
Expand Down

0 comments on commit 9afa8e9

Please sign in to comment.