Skip to content

Commit 4bbd826

Browse files
committed
build(deps): upgrade x86_64 to 0.16
1 parent 29dd138 commit 4bbd826

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

src/arch/x86_64/kernel/core_local.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ impl CoreLocal {
7878
};
7979
this.this = ptr::from_ref(this);
8080

81-
GsBase::write(VirtAddr::from_ptr(this));
81+
unsafe {
82+
GsBase::write(VirtAddr::from_ptr(this));
83+
}
8284
}
8385

8486
#[inline]

src/arch/x86_64/kernel/processor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,9 @@ pub fn writefs(fs: usize) {
11541154
FS::write_base(base);
11551155
}
11561156
} else {
1157-
FsBase::write(base);
1157+
unsafe {
1158+
FsBase::write(base);
1159+
}
11581160
}
11591161
}
11601162

@@ -1166,7 +1168,9 @@ pub fn writegs(gs: usize) {
11661168
GS::write_base(base);
11671169
}
11681170
} else {
1169-
GsBase::write(base);
1171+
unsafe {
1172+
GsBase::write(base);
1173+
}
11701174
}
11711175
}
11721176

src/arch/x86_64/mm/paging.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub unsafe fn identity_mapped_page_table() -> OffsetPageTable<'static> {
112112
ptr::with_exposed_provenance_mut::<PageTable>(level_4_table_addr.try_into().unwrap());
113113
unsafe {
114114
let level_4_table = level_4_table_ptr.as_mut().unwrap();
115-
OffsetPageTable::new(level_4_table, x86_64::addr::VirtAddr::new(0x0))
115+
OffsetPageTable::from_phys_offset(level_4_table, x86_64::addr::VirtAddr::new(0x0))
116116
}
117117
}
118118

@@ -179,7 +179,7 @@ pub fn map<S>(
179179
for (page, frame) in pages.zip(frames) {
180180
// TODO: Require explicit unmaps
181181
let unmap = mapper.unmap(page);
182-
if let Ok((_frame, flush)) = unmap {
182+
if let Ok((_frame, _flags, flush)) = unmap {
183183
unmapped = true;
184184
flush.flush();
185185
debug!("Had to unmap page {page:?} before mapping.");
@@ -265,7 +265,7 @@ where
265265
for page in range {
266266
let unmap_result = unsafe { identity_mapped_page_table() }.unmap(page);
267267
match unmap_result {
268-
Ok((_frame, flush)) => flush.flush(),
268+
Ok((_frame, _flags, flush)) => flush.flush(),
269269
// FIXME: Some sentinel pages around stacks are supposed to be unmapped.
270270
// We should handle this case there instead of here.
271271
Err(UnmapError::PageNotMapped) => {
@@ -372,7 +372,7 @@ pub unsafe fn log_page_tables() {
372372
}
373373

374374
let page_table = unsafe { identity_mapped_page_table() };
375-
trace!("Page tables:\n{}", page_table.display());
375+
trace!("Page tables:\n{}", OffsetPageTableExt::display(&page_table));
376376
}
377377

378378
pub mod mapped_page_range_display {
@@ -961,7 +961,7 @@ mod walker {
961961
) -> Result<&'b PageTable, PageTableWalkError> {
962962
let page_table_ptr = self
963963
.page_table_frame_mapping
964-
.frame_to_pointer(entry.frame()?);
964+
.frame_to_pointer(entry.frame(false)?);
965965
let page_table: &PageTable = unsafe { &*page_table_ptr };
966966

967967
Ok(page_table)

0 commit comments

Comments
 (0)