Fix a bunch of warnings.

This commit is contained in:
4lDO2
2024-07-08 13:01:25 +02:00
parent c86f107344
commit 5e7db80285
52 changed files with 105 additions and 166 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ use spin::RwLock;
use crate::{
context::{self, file::{FileDescription, FileDescriptor, InternalFlags}, memory::{AddrSpace, PageSpan}},
paging::{Page, VirtualAddress, PAGE_SIZE},
scheme::{self, CallerCtx, FileHandle, KernelScheme, OpenResult, SchemeId},
scheme::{self, CallerCtx, FileHandle, KernelScheme, OpenResult},
syscall::{data::Stat, error::*, flag::*},
};
+4 -4
View File
@@ -7,7 +7,7 @@ use syscall::EINTR;
use core::sync::atomic::{AtomicU32, Ordering};
use rmm::Arch;
use spin::RwLock;
use spinning_top::{guard::RwSpinlockUpgradableReadGuard, RwSpinlock};
use spinning_top::RwSpinlock;
use crate::{
context::{self, memory::{AddrSpace, AddrSpaceWrapper}, Context},
@@ -18,8 +18,8 @@ use crate::{
use crate::syscall::{
data::TimeSpec,
error::{Error, Result, EAGAIN, EFAULT, EINVAL, ESRCH, ETIMEDOUT},
flag::{FUTEX_REQUEUE, FUTEX_WAIT, FUTEX_WAIT64, FUTEX_WAKE},
error::{Error, Result, EAGAIN, EFAULT, EINVAL, ETIMEDOUT},
flag::{FUTEX_WAIT, FUTEX_WAIT64, FUTEX_WAKE},
};
use super::usercopy::UserSlice;
@@ -60,7 +60,7 @@ fn validate_and_translate_virt(space: &AddrSpace, addr: VirtualAddress) -> Optio
Some(frame.add(off))
}
pub fn futex(addr: usize, op: usize, val: usize, val2: usize, addr2: usize) -> Result<usize> {
pub fn futex(addr: usize, op: usize, val: usize, val2: usize, _addr2: usize) -> Result<usize> {
let current_addrsp = AddrSpace::current()?;
// Keep the address space locked so we can safely read from the physical address. Unlock it
+2 -2
View File
@@ -16,7 +16,7 @@ pub use self::{
use self::{
data::{Map, TimeSpec},
error::{Error, Result, EINTR, EOVERFLOW, ENOSYS},
error::{Error, Result, EOVERFLOW, ENOSYS},
flag::{EventFlags, MapFlags, WaitFlags},
number::*,
usercopy::UserSlice,
@@ -66,7 +66,7 @@ pub fn syscall(
d: usize,
e: usize,
f: usize,
stack: &mut InterruptStack,
_stack: &mut InterruptStack,
) -> usize {
#[inline(always)]
fn inner(
+5 -5
View File
@@ -6,7 +6,7 @@ use rmm::Arch;
use spin::RwLock;
use crate::context::{
memory::{AddrSpace, Grant, PageSpan}, switch::SwitchResult, ContextId, WaitpidKey
memory::{AddrSpace, Grant, PageSpan}, ContextId, WaitpidKey
};
use crate::{
@@ -24,7 +24,7 @@ use crate::{
Bootstrap, CurrentRmmArch,
};
use super::usercopy::{UserSliceRo, UserSliceWo, UserSlice};
use super::usercopy::UserSliceWo;
pub fn exit(status: usize) -> ! {
ptrace::breakpoint_callback(
@@ -106,7 +106,7 @@ pub fn exit(status: usize) -> ! {
ptrace::close_tracee(pid);
}
let _ = unsafe { context::switch() };
let _ = context::switch();
unreachable!();
}
@@ -187,7 +187,7 @@ pub fn kill(pid: ContextId, sig: usize, parent_sigchld: bool) -> Result<usize> {
// will additionally ignore, defer, or handle that signal.
context.status = context::Status::Runnable;
if let Some((tctl, pctl, st)) = context.sigcontrol() {
if let Some((tctl, pctl, _st)) = context.sigcontrol() {
if !pctl.signal_will_ign(SIGCONT, false) {
tctl.word[0].fetch_or(sig_bit(SIGCONT), Ordering::Relaxed);
}
@@ -212,7 +212,7 @@ pub fn kill(pid: ContextId, sig: usize, parent_sigchld: bool) -> Result<usize> {
// exit() will signal the parent, rather than immediately in kill()
SendResult::Succeeded
} else if let Some((tctl, pctl, st)) = context.sigcontrol() && !pctl.signal_will_ign(sig, parent_sigchld) {
} else if let Some((tctl, pctl, _st)) = context.sigcontrol() && !pctl.signal_will_ign(sig, parent_sigchld) {
let _was_new = tctl.word[sig_group].fetch_or(sig_bit(sig), Ordering::Relaxed);
if (tctl.word[sig_group].load(Ordering::Relaxed) >> 32) & sig_bit(sig) != 0 {
context.unblock();
-6
View File
@@ -192,12 +192,6 @@ impl<const READ: bool> UserSlice<READ, true> {
.copy_from_slice(&int.to_ne_bytes())?;
Ok(())
}
pub fn write_u64(self, int: u64) -> Result<()> {
self.limit(core::mem::size_of::<u64>())
.ok_or(Error::new(EINVAL))?
.copy_from_slice(&int.to_ne_bytes())?;
Ok(())
}
}
impl UserSliceRo {