mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 02:48:11 +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
2 changed files with 0 additions and 39 deletions
|
@ -207,18 +207,6 @@ Vector<PhysicalAddress> MemoryManager::allocatePhysicalPages(size_t count)
|
||||||
return pages;
|
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()
|
void MemoryManager::enter_kernel_paging_scope()
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
|
@ -420,24 +408,3 @@ bool MemoryManager::mapRegionsForTask(Task& task)
|
||||||
}
|
}
|
||||||
return true;
|
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:
|
private:
|
||||||
friend class MemoryManager;
|
friend class MemoryManager;
|
||||||
friend bool copyToZone(Zone&, const void* data, size_t);
|
|
||||||
explicit Zone(Vector<PhysicalAddress>&&);
|
explicit Zone(Vector<PhysicalAddress>&&);
|
||||||
|
|
||||||
Vector<PhysicalAddress> m_pages;
|
Vector<PhysicalAddress> m_pages;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool copyToZone(Zone&, const void* data, size_t);
|
|
||||||
|
|
||||||
#define MM MemoryManager::the()
|
#define MM MemoryManager::the()
|
||||||
|
|
||||||
class MemoryManager {
|
class MemoryManager {
|
||||||
|
@ -49,9 +46,6 @@ public:
|
||||||
|
|
||||||
RetainPtr<Zone> createZone(size_t);
|
RetainPtr<Zone> createZone(size_t);
|
||||||
|
|
||||||
// HACK: don't use this jeez :(
|
|
||||||
byte* quickMapOnePage(PhysicalAddress);
|
|
||||||
|
|
||||||
bool mapSubregion(Task&, Task::Subregion&);
|
bool mapSubregion(Task&, Task::Subregion&);
|
||||||
bool unmapSubregion(Task&, Task::Subregion&);
|
bool unmapSubregion(Task&, Task::Subregion&);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue