VMManager: remove all backing block related functions

The shared_ptr<vector> type backing memory is unused now, and is not expected to be used in the future
This commit is contained in:
Weiyi Wang
2018-11-16 00:16:13 -05:00
parent 7f9873d7ec
commit b6ab4e466b
4 changed files with 1 additions and 77 deletions
-27
View File
@@ -18,13 +18,10 @@ namespace Kernel {
enum class VMAType : u8 {
/// VMA represents an unmapped region of the address space.
Free,
/// VMA is backed by a ref-counted allocate memory block.
AllocatedMemoryBlock,
/// VMA is backed by a raw, unmanaged pointer.
BackingMemory,
/// VMA is mapped to MMIO registers at a fixed PAddr.
MMIO,
// TODO(yuriks): Implement MemoryAlias to support MAP/UNMAP
};
/// Permissions for mapped memory blocks
@@ -72,12 +69,6 @@ struct VirtualMemoryArea {
/// Tag returned by svcQueryMemory. Not otherwise used.
MemoryState meminfo_state = MemoryState::Free;
// Settings for type = AllocatedMemoryBlock
/// Memory block backing this VMA.
std::shared_ptr<std::vector<u8>> backing_block = nullptr;
/// Offset into the backing_memory the mapping starts from.
std::size_t offset = 0;
// Settings for type = BackingMemory
/// Pointer backing this VMA. It will not be destroyed or freed when the VMA is removed.
u8* backing_memory = nullptr;
@@ -133,18 +124,6 @@ public:
// TODO(yuriks): Should these functions actually return the handle?
/**
* Maps part of a ref-counted block of memory at a given address.
*
* @param target The guest address to start the mapping at.
* @param block The block to be mapped.
* @param offset Offset into `block` to map from.
* @param size Size of the mapping.
* @param state MemoryState tag to attach to the VMA.
*/
ResultVal<VMAHandle> MapMemoryBlock(VAddr target, std::shared_ptr<std::vector<u8>> block,
std::size_t offset, u32 size, MemoryState state);
/**
* Maps part of a ref-counted block of memory at the first free address after the given base.
*
@@ -203,12 +182,6 @@ public:
/// Changes the permissions of a range of addresses, splitting VMAs as necessary.
ResultCode ReprotectRange(VAddr target, u32 size, VMAPermission new_perms);
/**
* Scans all VMAs and updates the page table range of any that use the given vector as backing
* memory. This should be called after any operation that causes reallocation of the vector.
*/
void RefreshMemoryBlockMappings(const std::vector<u8>* block);
/// Dumps the address space layout to the log, for debugging
void LogLayout(Log::Level log_level) const;