mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
Remove some unused MM functions.
These were just Q&D hacks I used while bringing up the paging code.
This commit is contained in:
parent
0f70b9105f
commit
c178d7a9e3
Notes:
sideshowbarker
2024-07-19 18:35:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c178d7a9e30
2 changed files with 0 additions and 39 deletions
|
@ -207,18 +207,6 @@ Vector<PhysicalAddress> MemoryManager::allocatePhysicalPages(size_t count)
|
|||
return pages;
|
||||
}
|
||||
|
||||
byte* MemoryManager::quickMapOnePage(PhysicalAddress physicalAddress)
|
||||
{
|
||||
ASSERT_INTERRUPTS_DISABLED();
|
||||
auto pte = ensurePTE(m_kernel_page_directory, LinearAddress(4 * MB));
|
||||
kprintf("MM: quickmap %x @ %x {pte @ %p}\n", physicalAddress.get(), 4*MB, pte.ptr());
|
||||
pte.setPhysicalPageBase(physicalAddress.pageBase());
|
||||
pte.setPresent(true);
|
||||
pte.setWritable(true);
|
||||
flushTLB(LinearAddress(4 * MB));
|
||||
return (byte*)(4 * MB);
|
||||
}
|
||||
|
||||
void MemoryManager::enter_kernel_paging_scope()
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
|
@ -420,24 +408,3 @@ bool MemoryManager::mapRegionsForTask(Task& task)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool copyToZone(Zone& zone, const void* data, size_t size)
|
||||
{
|
||||
if (zone.size() < size) {
|
||||
kprintf("MM: copyToZone: can't fit %u bytes into zone with size %u\n", size, zone.size());
|
||||
return false;
|
||||
}
|
||||
|
||||
InterruptDisabler disabler;
|
||||
auto* dataptr = (const byte*)data;
|
||||
size_t remaining = size;
|
||||
for (size_t i = 0; i < zone.m_pages.size(); ++i) {
|
||||
byte* dest = MM.quickMapOnePage(zone.m_pages[i]);
|
||||
kprintf("memcpy(%p, %p, %u)\n", dest, dataptr, min(PAGE_SIZE, remaining));
|
||||
memcpy(dest, dataptr, min(PAGE_SIZE, remaining));
|
||||
dataptr += PAGE_SIZE;
|
||||
remaining -= PAGE_SIZE;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,14 +25,11 @@ public:
|
|||
|
||||
private:
|
||||
friend class MemoryManager;
|
||||
friend bool copyToZone(Zone&, const void* data, size_t);
|
||||
explicit Zone(Vector<PhysicalAddress>&&);
|
||||
|
||||
Vector<PhysicalAddress> m_pages;
|
||||
};
|
||||
|
||||
bool copyToZone(Zone&, const void* data, size_t);
|
||||
|
||||
#define MM MemoryManager::the()
|
||||
|
||||
class MemoryManager {
|
||||
|
@ -49,9 +46,6 @@ public:
|
|||
|
||||
RetainPtr<Zone> createZone(size_t);
|
||||
|
||||
// HACK: don't use this jeez :(
|
||||
byte* quickMapOnePage(PhysicalAddress);
|
||||
|
||||
bool mapSubregion(Task&, Task::Subregion&);
|
||||
bool unmapSubregion(Task&, Task::Subregion&);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue