Remove mfc_thread

Clear mfc_queue on reset
Improve MFC Proxy a bit
This commit is contained in:
Nekotekina 2018-03-25 00:03:32 +03:00
parent 78dbc4fb5f
commit 898637f830
9 changed files with 477 additions and 605 deletions

View file

@ -417,11 +417,6 @@ enum FPSCR_EX
FPSCR_DDENORM = 1 << 8, //Denormal
};
enum
{
max_imm_dma_size = 0x4000, // Custom constant, represents the max number of bytes our mfc can transfer immediately, else enqueueing the command
};
//Is 128 bits, but bits 0-19, 24-28, 32-49, 56-60, 64-81, 88-92, 96-115, 120-124 are unused
class SPU_FPSCR
{
@ -534,11 +529,10 @@ public:
// MFC command data
spu_mfc_cmd ch_mfc_cmd;
// MFC command queue (consumer: MFC thread)
lf_spsc<spu_mfc_cmd, 16> mfc_queue;
// MFC command proxy queue (consumer: MFC thread)
lf_mpsc<spu_mfc_cmd, 8> mfc_proxy;
// MFC command queue
spu_mfc_cmd mfc_queue[16]{};
u32 mfc_size = 0;
atomic_t<u32> mfc_prxy_mask;
// Reservation Data
u64 rtime = 0;
@ -546,17 +540,15 @@ public:
u32 raddr = 0;
u32 srr0;
atomic_t<u32> ch_tag_upd;
atomic_t<u32> ch_tag_mask;
u32 ch_tag_upd;
u32 ch_tag_mask;
spu_channel_t ch_tag_stat;
atomic_t<u32> ch_stall_mask;
u32 ch_stall_mask;
spu_channel_t ch_stall_stat;
spu_channel_t ch_atomic_stat;
spu_channel_4_t ch_in_mbox;
atomic_t<u32> mfc_prxy_mask;
spu_channel_t ch_out_mbox;
spu_channel_t ch_out_intr_mbox;
@ -596,9 +588,14 @@ public:
u32 recursion_level = 0;
void push_snr(u32 number, u32 value);
void do_dma_transfer(const spu_mfc_cmd& args, bool from_mfc = true);
void do_dma_transfer(const spu_mfc_cmd& args);
bool do_dma_check(const spu_mfc_cmd& args);
bool do_list_transfer(spu_mfc_cmd& args);
bool do_putlluc(const spu_mfc_cmd& args);
void do_mfc();
u32 get_mfc_completed();
void process_mfc_cmd();
bool process_mfc_cmd(spu_mfc_cmd args);
u32 get_events(bool waiting = false);
void set_events(u32 mask);
void set_interrupt_status(bool enable);