Skip to content

Commit

Permalink
add allow dead_code and process Result in KVM
Browse files Browse the repository at this point in the history
  • Loading branch information
yodalee committed May 17, 2023
1 parent 5464d4d commit 5094a2d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub fn init_user_pagetable(proc: &Proc) -> Option<NonNull<PageTable>> {
PAGESIZE,
PteFlag::PTE_READ | PteFlag::PTE_EXEC,
) {
unmap_free(page_table, 0);
unmap_free(page_table, 0).unwrap();
return None;
};

Expand All @@ -240,8 +240,8 @@ pub fn init_user_pagetable(proc: &Proc) -> Option<NonNull<PageTable>> {
PAGESIZE,
PteFlag::PTE_READ | PteFlag::PTE_WRITE,
) {
unmap_pages(page_table, VirtAddr::new(TRAMPOLINE), 1, false);
unmap_free(page_table, 0);
unmap_pages(page_table, VirtAddr::new(TRAMPOLINE), 1, false).unwrap();
unmap_free(page_table, 0).unwrap();
return None;
};
Some(page_table_ptr)
Expand Down
2 changes: 2 additions & 0 deletions src/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ pub const MAXVA: u64 = 1 << (9 + 9 + 9 + 12 - 1);
// Maximum Interrupt Count
pub const MAX_INTERRUPT: u64 = 1024;

#[allow(dead_code)]
pub enum Interrupt {
SupervisorSoftware = 1,
SupervisorTimer = 5,
SupervisorExternal = 9,
}

#[allow(dead_code)]
pub enum Exception {
InstructionAddressMisaligned = 0,
InstructionAccessFault = 1,
Expand Down
1 change: 1 addition & 0 deletions src/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ lazy_static! {
static ref SYSCALLS: [SyscallEntry; SYSCALL_NUM] = [syscall_write];
}

#[allow(dead_code)]
enum ArgIndex {
A0,
A1,
Expand Down
1 change: 1 addition & 0 deletions src/virtio/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub struct BlockRequest {

#[repr(u32)]
#[derive(Debug)]
#[allow(dead_code)]
pub enum RequestType {
In = 0,
Out = 1,
Expand Down
1 change: 1 addition & 0 deletions src/virtio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod header;
pub mod queue;

#[derive(Debug)]
#[allow(dead_code)]
pub enum Error {
/// Device status not OK
HeaderInitError,
Expand Down
1 change: 1 addition & 0 deletions src/vm/page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ impl PageTableIndex {
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[allow(dead_code)]
pub enum PageTableLevel {
/// Level 0, table of page
Zero = 0,
Expand Down

0 comments on commit 5094a2d

Please sign in to comment.