1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

Meta+Kernel: Make clang-format-10 clean

This commit is contained in:
Ben Wiederhake 2020-09-18 09:49:51 +02:00 committed by Andreas Kling
parent fa62c5595e
commit 64cc3f51d0
61 changed files with 123 additions and 118 deletions

View file

@ -26,8 +26,8 @@
#pragma once
#include <Kernel/VM/VMObject.h>
#include <Kernel/PhysicalAddress.h>
#include <Kernel/VM/VMObject.h>
namespace Kernel {

View file

@ -33,6 +33,7 @@
#include <Kernel/Heap/kmalloc.h>
#include <Kernel/Multiboot.h>
#include <Kernel/Process.h>
#include <Kernel/StdLib.h>
#include <Kernel/VM/AnonymousVMObject.h>
#include <Kernel/VM/ContiguousVMObject.h>
#include <Kernel/VM/MemoryManager.h>
@ -40,7 +41,6 @@
#include <Kernel/VM/PhysicalRegion.h>
#include <Kernel/VM/PurgeableVMObject.h>
#include <Kernel/VM/SharedInodeVMObject.h>
#include <Kernel/StdLib.h>
//#define MM_DEBUG
//#define PAGE_FAULT_DEBUG
@ -235,6 +235,7 @@ PageTableEntry* MemoryManager::ensure_pte(PageDirectory& page_directory, Virtual
// we're writing to the correct underlying physical page
pd = quickmap_pd(page_directory, page_directory_table_index);
ASSERT(&pde == &pd[page_directory_index]); // Sanity check
ASSERT(!pde.is_present()); // Should have not changed
}
#ifdef MM_DEBUG

View file

@ -89,7 +89,7 @@ public:
static bool is_initialized();
static void initialize(u32 cpu);
static inline MemoryManagerData& get_data()
{
return Processor::current().get_mm_data();

View file

@ -67,7 +67,7 @@ public:
private:
PhysicalPage(PhysicalAddress paddr, bool supervisor, bool may_return_to_freelist = true);
~PhysicalPage() {}
~PhysicalPage() { }
void return_to_freelist() const;

View file

@ -95,19 +95,19 @@ Optional<unsigned> PhysicalRegion::find_one_free_page()
// We know we don't have any free pages, no need to check the bitmap
// Check if we can draw one from the return queue
if (m_recently_returned.size() > 0) {
u8 index = get_fast_random<u8>() % m_recently_returned.size();
ptrdiff_t local_offset = m_recently_returned[index].get() - m_lower.get();
m_recently_returned.remove(index);
ASSERT(local_offset >= 0);
ASSERT((FlatPtr)local_offset < (FlatPtr)(m_pages * PAGE_SIZE));
return local_offset / PAGE_SIZE;
u8 index = get_fast_random<u8>() % m_recently_returned.size();
ptrdiff_t local_offset = m_recently_returned[index].get() - m_lower.get();
m_recently_returned.remove(index);
ASSERT(local_offset >= 0);
ASSERT((FlatPtr)local_offset < (FlatPtr)(m_pages * PAGE_SIZE));
return local_offset / PAGE_SIZE;
}
return {};
}
auto free_index = m_bitmap.find_one_anywhere_unset(m_free_hint);
if (!free_index.has_value())
return {};
auto page_index = free_index.value();
m_bitmap.set(page_index, true);
m_used++;

View file

@ -39,7 +39,7 @@ class PhysicalRegion : public RefCounted<PhysicalRegion> {
public:
static NonnullRefPtr<PhysicalRegion> create(PhysicalAddress lower, PhysicalAddress upper);
~PhysicalRegion() {}
~PhysicalRegion() { }
void expand(PhysicalAddress lower, PhysicalAddress upper);
unsigned finalize_capacity();

View file

@ -85,7 +85,7 @@ int PurgeableVMObject::purge_impl()
if (purged_page_count > 0) {
for_each_region([&](auto& region) {
if (&region.vmobject() == this)
region.remap();
region.remap();
});
}

View file

@ -37,7 +37,7 @@ class Range {
friend class RangeAllocator;
public:
Range() {}
Range() { }
Range(VirtualAddress base, size_t size)
: m_base(base)
, m_size(size)

View file

@ -118,7 +118,7 @@ public:
{
return (vaddr - m_range.base()).get() / PAGE_SIZE;
}
VirtualAddress vaddr_from_page_index(size_t page_index) const
{
return vaddr().offset(page_index * PAGE_SIZE);
@ -238,5 +238,4 @@ inline unsigned prot_to_region_access_flags(int prot)
return access;
}
}