Skip to content

Commit

Permalink
DSP: Make mailboxes private
Browse files Browse the repository at this point in the history
These aren't used externally anywhere and can be made private.
  • Loading branch information
lioncash committed Dec 29, 2020
1 parent 024e983 commit f9d8d06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/Core/Core/DSP/DSPCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ void SDSP::DoState(PointerWrap& p)
p.Do(step_counter);
p.DoArray(ifx_regs);
accelerator->DoState(p);
p.Do(mbox[0]);
p.Do(mbox[1]);
p.Do(m_mailbox[0]);
p.Do(m_mailbox[1]);
Common::UnWriteProtectMemory(iram, DSP_IRAM_BYTE_SIZE, false);
p.DoArray(iram, DSP_IRAM_SIZE);
Common::WriteProtectMemory(iram, DSP_IRAM_BYTE_SIZE, false);
Expand Down
8 changes: 3 additions & 5 deletions Source/Core/Core/DSP/DSPCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,6 @@ struct SDSP
u32 iram_crc = 0;
u64 step_counter = 0;

// Mailbox.
std::atomic<u32> mbox[2];

// Accelerator / DMA / other hardware registers. Not GPRs.
std::array<u16, 256> ifx_regs{};

Expand All @@ -445,8 +442,8 @@ struct SDSP
u16* coef = nullptr;

private:
auto& GetMailbox(Mailbox mailbox) { return mbox[static_cast<u32>(mailbox)]; }
const auto& GetMailbox(Mailbox mailbox) const { return mbox[static_cast<u32>(mailbox)]; }
auto& GetMailbox(Mailbox mailbox) { return m_mailbox[static_cast<u32>(mailbox)]; }
const auto& GetMailbox(Mailbox mailbox) const { return m_mailbox[static_cast<u32>(mailbox)]; }

void FreeMemoryPages();

Expand All @@ -458,6 +455,7 @@ struct SDSP

u16 ReadIFXImpl(u16 address);

std::atomic<u32> m_mailbox[2];
DSPCore& m_dsp_core;
Analyzer m_analyzer;
};
Expand Down

0 comments on commit f9d8d06

Please sign in to comment.