Kernel/IPC: Partially implement MappedBuffer translation.

Right now only MappedBuffers that only span a single page and are not aligned are implemented.

MappedBuffers are unmapped during the reply part of ReplyAndReceive. Only unmapping of ReadOnly buffers is currently implemented.
This commit is contained in:
Subv
2017-11-07 14:35:17 -05:00
parent 928202f744
commit a7a5c5aa0d
5 changed files with 102 additions and 14 deletions

View File

@@ -148,14 +148,16 @@ public:
* Maps part of a ref-counted block of memory at the first free address after the given base.
*
* @param base The base address to start the mapping at.
* @param region_size The max size of the region from where we'll try to find an address.
* @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.
* @returns The address at which the memory was mapped.
*/
ResultVal<VAddr> MapMemoryBlockToBase(VAddr base, std::shared_ptr<std::vector<u8>> block,
size_t offset, u32 size, MemoryState state);
ResultVal<VAddr> MapMemoryBlockToBase(VAddr base, u32 region_size,
std::shared_ptr<std::vector<u8>> block, size_t offset,
u32 size, MemoryState state);
/**
* Maps an unmanaged host memory pointer at a given address.
*
@@ -236,4 +238,4 @@ private:
/// Updates the pages corresponding to this VMA so they match the VMA's attributes.
void UpdatePageTableForVMA(const VirtualMemoryArea& vma);
};
}
} // namespace Kernel