MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / send_command

Method send_command

ps3fw/cellAdec.cpp:790–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788
789template <LpcmDecCmdType type>
790error_code LpcmDecContext::send_command(ppu_thread& ppu, auto&&... args)
791{
792 ppu.state += cpu_flag::wait;
793
794 if (error_code ret = sys_mutex_lock(ppu, queue_size_mutex, 0); ret != CELL_OK)
795 {
796 return ret;
797 }
798
799 if (cmd_queue.full())
800 {
801 ensure(sys_mutex_unlock(ppu, queue_size_mutex) == CELL_OK); // Error code isn't checked on LLE
802 return CELL_ADEC_ERROR_BUSY;
803 }
804
805 // LLE copies the parameters directly into the context
806 if constexpr (type == LpcmDecCmdType::start_seq)
807 {
808 *lpcm_param = {args...};
809 }
810
811 if (error_code ret = sys_mutex_lock(ppu, queue_mutex, 0); ret != CELL_OK)
812 {
813 ensure(sys_mutex_unlock(ppu, queue_size_mutex) == CELL_OK); // Error code isn't checked on LLE
814 return ret;
815 }
816
817 cmd_queue.emplace(type, std::forward<decltype(args)>(args)...);
818
819 if (error_code ret = sys_mutex_unlock(ppu, queue_mutex); ret != CELL_OK || (ret = cmd_available.release(ppu)) != CELL_OK)
820 {
821 ensure(sys_mutex_unlock(ppu, queue_size_mutex) == CELL_OK); // Error code isn't checked on LLE
822 return ret;
823 }
824
825 return sys_mutex_unlock(ppu, queue_size_mutex);
826}
827
828inline error_code LpcmDecContext::release_output(ppu_thread& ppu)
829{

Callers

nothing calls this directly

Calls 6

sys_mutex_lockFunction · 0.85
sys_mutex_unlockFunction · 0.85
ensureFunction · 0.50
fullMethod · 0.45
emplaceMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected