Fix warnings
This commit is contained in:
@@ -120,7 +120,7 @@ impl<A: Arch> BuddyAllocator<A> {
|
||||
for i in 0 .. (A::PAGE_SIZE / mem::size_of::<BuddyEntry<A>>()) {
|
||||
let virt = table_virt.add(i * mem::size_of::<BuddyEntry<A>>());
|
||||
let mut entry = A::read::<BuddyEntry<A>>(virt);
|
||||
let inserted = if area.base.add(area.size) == entry.base {
|
||||
let inserted = if area.base.add(area.size) == { entry.base } {
|
||||
// Combine entry at start
|
||||
entry.base = area.base;
|
||||
entry.size += area.size;
|
||||
@@ -247,8 +247,8 @@ impl<A: Arch> FrameAllocator for BuddyAllocator<A> {
|
||||
let virt = self.table_virt.add(i * mem::size_of::<BuddyEntry<A>>());
|
||||
let mut entry = A::read::<BuddyEntry<A>>(virt);
|
||||
|
||||
if base >= entry.base && base.add(size) <= entry.base.add(entry.size) {
|
||||
let start_page = (base.data() - entry.base.data()) >> A::PAGE_SHIFT;
|
||||
if base >= { entry.base } && base.add(size) <= entry.base.add(entry.size) {
|
||||
let start_page = (base.data() - { entry.base }.data()) >> A::PAGE_SHIFT;
|
||||
for page in start_page..start_page + count.data() {
|
||||
let mut usage = entry.usage(page).expect("failed to get usage during free");
|
||||
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ impl Arch for AArch64Arch {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
unsafe fn invalidate(address: VirtualAddress) {
|
||||
unsafe fn invalidate(_address: VirtualAddress) {
|
||||
//TODO: can one address be invalidated?
|
||||
Self::invalidate_all();
|
||||
}
|
||||
@@ -87,8 +87,8 @@ impl Arch for AArch64Arch {
|
||||
Self::invalidate_all();
|
||||
}
|
||||
|
||||
fn virt_is_valid(address: VirtualAddress) -> bool {
|
||||
// FIXME
|
||||
fn virt_is_valid(_address: VirtualAddress) -> bool {
|
||||
//TODO: what makes an address valid on aarch64?
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ use core::ptr;
|
||||
use crate::{
|
||||
MemoryArea,
|
||||
PhysicalAddress,
|
||||
TableKind,
|
||||
VirtualAddress,
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ use crate::{
|
||||
Arch,
|
||||
MemoryArea,
|
||||
PhysicalAddress,
|
||||
TableKind,
|
||||
VirtualAddress,
|
||||
};
|
||||
|
||||
@@ -40,7 +39,7 @@ impl Arch for RiscV64Sv39Arch {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
unsafe fn invalidate(address: VirtualAddress) {
|
||||
unsafe fn invalidate(_address: VirtualAddress) {
|
||||
//TODO: can one address be invalidated?
|
||||
Self::invalidate_all();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ use crate::{
|
||||
Arch,
|
||||
MemoryArea,
|
||||
PhysicalAddress,
|
||||
TableKind,
|
||||
VirtualAddress,
|
||||
};
|
||||
|
||||
@@ -40,7 +39,7 @@ impl Arch for RiscV64Sv48Arch {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
unsafe fn invalidate(address: VirtualAddress) {
|
||||
unsafe fn invalidate(_address: VirtualAddress) {
|
||||
//TODO: can one address be invalidated?
|
||||
Self::invalidate_all();
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ impl<A: Arch, F: FrameAllocator> PageMapper<A, F> {
|
||||
//TODO: verify virt is aligned
|
||||
let mut table = self.table();
|
||||
let level = table.level();
|
||||
unmap_phys_inner(virt, &mut table, level, false, &mut self.allocator).map(|(pa, pf)| (pa, pf, PageFlush::new(virt)))
|
||||
unmap_phys_inner(virt, &mut table, level, unmap_parents, &mut self.allocator).map(|(pa, pf)| (pa, pf, PageFlush::new(virt)))
|
||||
}
|
||||
}
|
||||
unsafe fn unmap_phys_inner<A: Arch>(virt: VirtualAddress, table: &mut PageTable<A>, initial_level: usize, unmap_parents: bool, allocator: &mut impl FrameAllocator) -> Option<(PhysicalAddress, PageFlags<A>)> {
|
||||
|
||||
Reference in New Issue
Block a user