Remove some warnings.
This commit is contained in:
parent
b121689d08
commit
08bc677d3b
4 changed files with 6 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#[allow(unused)]
|
||||||
|
|
||||||
pub const USER_STACK_SIZE: usize = 4096 * 2;
|
pub const USER_STACK_SIZE: usize = 4096 * 2;
|
||||||
pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
|
pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
|
||||||
pub const KERNEL_HEAP_SIZE: usize = 0x20_0000;
|
pub const KERNEL_HEAP_SIZE: usize = 0x20_0000;
|
||||||
|
|
|
@ -3,7 +3,6 @@ mod sdcard;
|
||||||
|
|
||||||
use lazy_static::*;
|
use lazy_static::*;
|
||||||
use alloc::sync::Arc;
|
use alloc::sync::Arc;
|
||||||
use core::any::Any;
|
|
||||||
use easy_fs::BlockDevice;
|
use easy_fs::BlockDevice;
|
||||||
|
|
||||||
#[cfg(feature = "board_qemu")]
|
#[cfg(feature = "board_qemu")]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
use virtio_drivers::{VirtIOBlk, VirtIOHeader};
|
use virtio_drivers::{VirtIOBlk, VirtIOHeader};
|
||||||
use crate::mm::{
|
use crate::mm::{
|
||||||
PhysAddr,
|
PhysAddr,
|
||||||
|
@ -15,6 +16,7 @@ use spin::Mutex;
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use lazy_static::*;
|
use lazy_static::*;
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
const VIRTIO0: usize = 0x10001000;
|
const VIRTIO0: usize = 0x10001000;
|
||||||
|
|
||||||
pub struct VirtIOBlock(Mutex<VirtIOBlk<'static>>);
|
pub struct VirtIOBlock(Mutex<VirtIOBlk<'static>>);
|
||||||
|
@ -33,6 +35,7 @@ impl BlockDevice for VirtIOBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VirtIOBlock {
|
impl VirtIOBlock {
|
||||||
|
#[allow(unused)]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self(Mutex::new(VirtIOBlk::new(
|
Self(Mutex::new(VirtIOBlk::new(
|
||||||
unsafe { &mut *(VIRTIO0 as *mut VirtIOHeader) }
|
unsafe { &mut *(VIRTIO0 as *mut VirtIOHeader) }
|
||||||
|
|
|
@ -11,7 +11,6 @@ use crate::mm::{
|
||||||
translated_refmut,
|
translated_refmut,
|
||||||
};
|
};
|
||||||
use crate::fs::{
|
use crate::fs::{
|
||||||
OSInode,
|
|
||||||
open_file,
|
open_file,
|
||||||
OpenFlags,
|
OpenFlags,
|
||||||
};
|
};
|
||||||
|
@ -87,7 +86,7 @@ pub fn sys_waitpid(pid: isize, exit_code_ptr: *mut i32) -> isize {
|
||||||
});
|
});
|
||||||
if let Some((idx, _)) = pair {
|
if let Some((idx, _)) = pair {
|
||||||
let child = inner.children.remove(idx);
|
let child = inner.children.remove(idx);
|
||||||
// confirm that child will be deallocated after removing from children list
|
// confirm that child will be deallocated after being removed from children list
|
||||||
assert_eq!(Arc::strong_count(&child), 1);
|
assert_eq!(Arc::strong_count(&child), 1);
|
||||||
let found_pid = child.getpid();
|
let found_pid = child.getpid();
|
||||||
// ++++ temporarily hold child lock
|
// ++++ temporarily hold child lock
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue