Skip to content

Commit 1426fc2

Browse files
committed
chore(lab/2): recovery imports
1 parent f752e4b commit 1426fc2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/0x02/pkg/kernel/src/interrupt/apic/xapic.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ impl XApic {
1717
}
1818

1919
unsafe fn read(&self, reg: u32) -> u32 {
20-
read_volatile((self.addr + reg as u64) as *const u32)
20+
unsafe {
21+
read_volatile((self.addr + reg as u64) as *const u32)
22+
}
2123
}
2224

2325
unsafe fn write(&mut self, reg: u32, value: u32) {
24-
write_volatile((self.addr + reg as u64) as *mut u32, value);
25-
self.read(0x20);
26+
unsafe {
27+
write_volatile((self.addr + reg as u64) as *mut u32, value);
28+
self.read(0x20);
29+
}
2630
}
2731
}
2832

src/0x02/pkg/kernel/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ pub mod memory;
2929
pub mod interrupt;
3030

3131
pub use alloc::format;
32+
3233
use boot::BootInfo;
34+
use uefi::{Status, runtime::ResetType};
3335

3436
pub fn init(boot_info: &'static BootInfo) {
3537
unsafe {

src/0x02/pkg/kernel/src/memory/frames.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alloc::boxed::Box;
12
use boot::{MemoryMap, MemoryType};
23
use x86_64::structures::paging::{FrameAllocator, FrameDeallocator, PhysFrame, Size4KiB};
34
use x86_64::PhysAddr;

0 commit comments

Comments
 (0)