diff options
author | Liam <byteslice@airmail.cc> | 2024-02-21 02:02:36 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-21 04:15:37 +0100 |
commit | 6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f (patch) | |
tree | 0c4925aa6e1c67ab3f91723c690ebfce90089356 /src/audio_core/renderer/memory/pool_mapper.cpp | |
parent | audio: split IHardwarweOpusDecoder, move IHardwareOpusDecoderManager (diff) | |
download | yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.gz yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.bz2 yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.lz yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.xz yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.zst yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.zip |
Diffstat (limited to 'src/audio_core/renderer/memory/pool_mapper.cpp')
-rw-r--r-- | src/audio_core/renderer/memory/pool_mapper.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/audio_core/renderer/memory/pool_mapper.cpp b/src/audio_core/renderer/memory/pool_mapper.cpp index 999bb746b..1df786feb 100644 --- a/src/audio_core/renderer/memory/pool_mapper.cpp +++ b/src/audio_core/renderer/memory/pool_mapper.cpp @@ -8,13 +8,13 @@ namespace AudioCore::Renderer { -PoolMapper::PoolMapper(u32 process_handle_, bool force_map_) +PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, bool force_map_) : process_handle{process_handle_}, force_map{force_map_} {} -PoolMapper::PoolMapper(u32 process_handle_, std::span<MemoryPoolInfo> pool_infos_, u32 pool_count_, - bool force_map_) - : process_handle{process_handle_}, pool_infos{pool_infos_.data()}, - pool_count{pool_count_}, force_map{force_map_} {} +PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, std::span<MemoryPoolInfo> pool_infos_, + u32 pool_count_, bool force_map_) + : process_handle{process_handle_}, pool_infos{pool_infos_.data()}, pool_count{pool_count_}, + force_map{force_map_} {} void PoolMapper::ClearUseState(std::span<MemoryPoolInfo> pools, const u32 count) { for (u32 i = 0; i < count; i++) { @@ -106,15 +106,17 @@ bool PoolMapper::IsForceMapEnabled() const { return force_map; } -u32 PoolMapper::GetProcessHandle(const MemoryPoolInfo* pool) const { +Kernel::KProcess* PoolMapper::GetProcessHandle(const MemoryPoolInfo* pool) const { switch (pool->GetLocation()) { case MemoryPoolInfo::Location::CPU: return process_handle; case MemoryPoolInfo::Location::DSP: - return Kernel::Svc::CurrentProcess; + // return Kernel::Svc::CurrentProcess; + return nullptr; } LOG_WARNING(Service_Audio, "Invalid MemoryPoolInfo location!"); - return Kernel::Svc::CurrentProcess; + // return Kernel::Svc::CurrentProcess; + return nullptr; } bool PoolMapper::Map([[maybe_unused]] const u32 handle, [[maybe_unused]] const CpuAddr cpu_addr, @@ -147,14 +149,14 @@ bool PoolMapper::Unmap([[maybe_unused]] const u32 handle, [[maybe_unused]] const } bool PoolMapper::Unmap(MemoryPoolInfo& pool) const { - [[maybe_unused]] u32 handle{0}; + [[maybe_unused]] Kernel::KProcess* handle{}; switch (pool.GetLocation()) { case MemoryPoolInfo::Location::CPU: handle = process_handle; break; case MemoryPoolInfo::Location::DSP: - handle = Kernel::Svc::CurrentProcess; + // handle = Kernel::Svc::CurrentProcess; break; } // nn::audio::dsp::UnmapUserPointer(handle, pool->cpu_address, pool->size); |