Skip to content

Commit 9afa8e9

Browse files
committed
Merge branch 'master' into next
2 parents 1745184 + f1cb4a0 commit 9afa8e9

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140

141141
- name: Cache binaries
142142
id: cache-bin
143-
uses: actions/cache@v3
143+
uses: actions/cache@v4
144144
with:
145145
path: binaries
146146
key: ${{ runner.OS }}-binaries

src/structures/paging/page.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ impl Page<Size1GiB> {
189189
p4_index: PageTableIndex,
190190
p3_index: PageTableIndex,
191191
) -> Self {
192-
use bit_field::BitField;
193-
194192
let mut addr = 0;
195-
addr.set_bits(39..48, u64::from(p4_index));
196-
addr.set_bits(30..39, u64::from(p3_index));
193+
addr |= u64::from(p4_index) << 39;
194+
addr |= u64::from(p3_index) << 30;
197195
Page::containing_address(VirtAddr::new_truncate(addr))
198196
}
199197
}
@@ -206,12 +204,10 @@ impl Page<Size2MiB> {
206204
p3_index: PageTableIndex,
207205
p2_index: PageTableIndex,
208206
) -> Self {
209-
use bit_field::BitField;
210-
211207
let mut addr = 0;
212-
addr.set_bits(39..48, u64::from(p4_index));
213-
addr.set_bits(30..39, u64::from(p3_index));
214-
addr.set_bits(21..30, u64::from(p2_index));
208+
addr |= u64::from(p4_index) << 39;
209+
addr |= u64::from(p3_index) << 30;
210+
addr |= u64::from(p2_index) << 21;
215211
Page::containing_address(VirtAddr::new_truncate(addr))
216212
}
217213
}
@@ -225,13 +221,11 @@ impl Page<Size4KiB> {
225221
p2_index: PageTableIndex,
226222
p1_index: PageTableIndex,
227223
) -> Self {
228-
use bit_field::BitField;
229-
230224
let mut addr = 0;
231-
addr.set_bits(39..48, u64::from(p4_index));
232-
addr.set_bits(30..39, u64::from(p3_index));
233-
addr.set_bits(21..30, u64::from(p2_index));
234-
addr.set_bits(12..21, u64::from(p1_index));
225+
addr |= u64::from(p4_index) << 39;
226+
addr |= u64::from(p3_index) << 30;
227+
addr |= u64::from(p2_index) << 21;
228+
addr |= u64::from(p1_index) << 12;
235229
Page::containing_address(VirtAddr::new_truncate(addr))
236230
}
237231

testing/x86_64-bare-metal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"llvm-target": "x86_64-unknown-none",
3-
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
3+
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
44
"arch": "x86_64",
55
"target-endian": "little",
66
"target-pointer-width": "64",

0 commit comments

Comments
 (0)