template <typename GpuMapping>
class AddressSpace
Defined at line 32 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
Public Methods
void AddressSpace<GpuMapping> (AddressSpaceOwner * owner)
Defined at line 38 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
std::unique_ptr<GpuMapping> MapBufferGpu (std::shared_ptr<AddressSpace<GpuMapping>>address_space,std::shared_ptr<Buffer>buffer,boolwriteable)
Defined at line 53 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
uint64_t MaxGuardPageCount ()
Returns the maximum number of guard pages that should be inserted after a mapping.
Defined at line 85 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool InsertWithBusMapping ()
By default the AddressSpace will perform a bus mapping first then call Insert(addr,
bus_mapping); however, some address spaces may require an external actor to perform the bus
mapping, so if this returns false then Insert(addr, buffer, page_offset, page_count) will be
called instead.
Defined at line 91 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool Alloc (size_tsize,uint8_talign_pow2,uint64_t *addr_out)
Allocates space and returns an address to the start of the allocation.
May return false if the AddressSpace doesn't support allocation.
Defined at line 95 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool Free (uint64_t addr)
Releases the allocation at the given address.
Defined at line 101 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool Insert (uint64_taddr,magma::PlatformBusMapper::BusMapping *bus_mapping,uint32_tguard_page_count)
Inserts the pages for the given buffer into page table entries for the allocation at the
given address.
Defined at line 108 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool Insert (uint64_taddr,magma::PlatformBuffer *buffer,uint64_tpage_offset,uint64_tpage_count)
Inserts without assuming a bus mapping; used if InsertWithBusMapping() is false.
Defined at line 115 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool Clear (uint64_t addr, magma::PlatformBusMapper::BusMapping * bus_mapping)
Clears the page table entries for the allocation at the given address.
Defined at line 122 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
uint64_t Size ()
void ~AddressSpace<GpuMapping> ()
Defined at line 40 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool CheckIfMappingFits (uint64_tgpu_addr,uint64_tlength,uint32_t *guard_page_count_out)
Defined at line 227 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
std::unique_ptr<GpuMapping> MapBufferGpu (std::shared_ptr<AddressSpace<GpuMapping>>address_space,std::shared_ptr<Buffer>buffer,uint64_toffset,uint64_tlength,boolwriteable)
Maps the given |buffer| to a gpu address created from the |address_space| allocator.
The address space must support allocation.
Defined at line 162 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
magma::Status MapBufferGpu (std::shared_ptr<AddressSpace<GpuMapping>>address_space,std::shared_ptr<Buffer>buffer,uint64_tgpu_addr,uint64_tpage_offset,uint64_tpage_count,std::shared_ptr<GpuMapping> *gpu_mapping_out,boolwriteable)
Maps the given |buffer| at the given gpu address.
Defined at line 262 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
magma::Status GrowMapping (GpuMapping * mapping, uint64_t page_count)
Defined at line 387 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
std::shared_ptr<GpuMapping> FindGpuMapping (uint64_t gpu_addr)
Defined at line 329 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
std::shared_ptr<GpuMapping> FindGpuMapping (magma::PlatformBuffer *buffer,uint64_toffset,uint64_tlength)
Returns a gpu mapping for the given buffer starting at the given offset if the mapping
length is at least the given length.
Defined at line 311 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool AddMapping (std::shared_ptr<GpuMapping> gpu_mapping)
Defined at line 335 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool ReleaseMapping (magma::PlatformBuffer *buffer,uint64_tgpu_addr,std::shared_ptr<GpuMapping> *mapping_out)
Defined at line 355 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
void ReleaseBuffer (magma::PlatformBuffer * buffer, std::vector<std::shared_ptr<GpuMapping>> * released_mappings_out)
Defined at line 372 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
Protected Methods
bool ClearLocked (uint64_t addr, magma::PlatformBusMapper::BusMapping * bus_mapping)
bool AllocLocked (size_tsize,uint8_talign_pow2,uint64_t *addr_out)
Defined at line 128 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool FreeLocked (uint64_t addr)
Defined at line 131 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h
bool InsertLocked (uint64_taddr,magma::PlatformBusMapper::BusMapping *bus_mapping,uint32_tguard_page_count)
bool InsertLocked (uint64_taddr,magma::PlatformBuffer *buffer,uint64_tpage_offset,uint64_tpage_count)
Defined at line 139 of file ../../src/graphics/magma/lib/magma_service/util/address_space.h