All: Cleanup all files
Add newline to end of files and remove whitespace from end of lines
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Kernel
|
||||
auto* region_ptr = new DMARegion(size, vaddr, paddr);
|
||||
if (region_ptr == nullptr)
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
|
||||
|
||||
vaddr_guard.disable();
|
||||
paddr_guard.disable();
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Kernel
|
||||
return BAN::Error::from_errno(ENOTSUP);
|
||||
if (m_type != Type::SHARED)
|
||||
return {};
|
||||
|
||||
|
||||
vaddr_t first_page = address & PAGE_ADDR_MASK;
|
||||
vaddr_t last_page = BAN::Math::div_round_up<vaddr_t>(address + size, PAGE_SIZE) * PAGE_SIZE;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Kernel
|
||||
|
||||
if (entry.type != 1)
|
||||
continue;
|
||||
|
||||
|
||||
paddr_t start = entry.address;
|
||||
if (start < V2P(g_kernel_end))
|
||||
start = V2P(g_kernel_end);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Kernel
|
||||
vaddr_t vaddr = address & PAGE_ADDR_MASK;
|
||||
if (m_page_table.physical_address_of(vaddr) != 0)
|
||||
return false;
|
||||
|
||||
|
||||
// Map new physcial page to address
|
||||
paddr_t paddr = Heap::get().take_free_page();
|
||||
if (paddr == 0)
|
||||
@@ -83,7 +83,7 @@ namespace Kernel
|
||||
continue;
|
||||
TRY(result->copy_data_to_region(offset, (const uint8_t*)(m_vaddr + offset), PAGE_SIZE));
|
||||
}
|
||||
|
||||
|
||||
return BAN::UniqPtr<MemoryRegion>(BAN::move(result));
|
||||
}
|
||||
|
||||
@@ -116,4 +116,4 @@ namespace Kernel
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Kernel
|
||||
, m_flags(flags)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
MemoryRegion::~MemoryRegion()
|
||||
{
|
||||
if (m_vaddr)
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Kernel
|
||||
paddr_t paddr = Heap::get().take_free_page();
|
||||
if (paddr == 0)
|
||||
return BAN::Error::from_errno(ENOMEM);
|
||||
result->m_page_table.map_page_at(paddr, vaddr() + offset, m_flags);
|
||||
result->m_page_table.map_page_at(paddr, vaddr() + offset, m_flags);
|
||||
}
|
||||
|
||||
CriticalScope _;
|
||||
@@ -218,4 +218,4 @@ namespace Kernel
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ struct kmalloc_node
|
||||
{
|
||||
uintptr_t node_end = end();
|
||||
set_end(data() + size);
|
||||
|
||||
|
||||
auto* next = after();
|
||||
next->set_end(node_end);
|
||||
next->set_align(0);
|
||||
@@ -124,10 +124,10 @@ void kmalloc_initialize()
|
||||
node->next = i - 1;
|
||||
node->prev = i + 1;
|
||||
}
|
||||
|
||||
|
||||
info.node_at(0)->next = kmalloc_fixed_info::node::invalid;
|
||||
info.node_at(info.node_count - 1)->prev = kmalloc_fixed_info::node::invalid;
|
||||
|
||||
|
||||
info.free_list_head = info.node_at(0);
|
||||
info.used_list_head = nullptr;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void kfree(void* address)
|
||||
else if (s_kmalloc_info.base <= address_uint && address_uint < s_kmalloc_info.end)
|
||||
{
|
||||
auto& info = s_kmalloc_info;
|
||||
|
||||
|
||||
auto* node = info.from_address(address);
|
||||
ASSERT(node);
|
||||
ASSERT(node->data() == (uintptr_t)address);
|
||||
|
||||
Reference in New Issue
Block a user