dolphin/Source/Core
Pierre Bourdon a770cc0778 DSPHLE MailHandler: Synchronize reads and interrupts
This change is meant to solve the following problem: how to translate the
following snippet to DSPHLE:
    SendInterruptAndWaitRead(MAIL_A);
    SendAndWaitRead(MAIL_B);

    SendInterruptAndWaitRead(MAIL_C);

This should cause the following actions on the CPU side:
    ---> Woken up by interrupt
    Reads MAIL_A
    Reads MAIL_B
    <--- Exits interrupt handler

    ---> Woken up by interrupt
    Reads MAIL_C
    <---

But with the current DSPHLE mail support, the following would happen because
the "AndWaitRead" part is not supported:
    ---> Woken up by interrupt
    Reads MAIL_A
    Reads MAIL_B
    <--- Exits interrupt handler

    [Never gets the second interrupt since it was triggered at the same time as
    the first one! Misses MAIL_C.]

This changes fixes the issue by storing two values in the mail queue on the DSP
side: the value of the mail itself, and whether a read of that mail should
trigger a DSP interrupt. If nothing is in the queue yet and an interrupt is
requested, just trigger the interrupt. In the present example, the queue will
look like this:
    Mail value       Interrupt requested
     MAIL_A                  No           <-- Interrupt was triggered when
                                              pushing the mail to the queue.
     MAIL_B                  Yes
     MAIL_C                  No

When the CPU will read MAIL_B, this will cause MailHandler to trigger the
interrupt, which will be handled by the CPU when coming back from the exception
handler. MAIL_C is then successfully read.
2015-08-14 16:01:27 +02:00
..
AudioCommon Don't busy wait in the audio thread (ALSA) 2015-08-11 03:54:54 +02:00
Common Arm64Emitter: Fix encoding of '2-reg misc' variant of FCMEQ 2015-08-10 19:48:36 -04:00
Core DSPHLE MailHandler: Synchronize reads and interrupts 2015-08-14 16:01:27 +02:00
DiscIO Remove unnecessary virtual keywords 2015-07-30 10:33:08 -04:00
DolphinQt Fix DoFileSearch returning the passed-in directories themselves. 2015-06-25 15:17:52 +02:00
DolphinWX Merge pull request #2807 from aserna3/master 2015-08-09 07:55:37 +02:00
InputCommon Fix building with PCH disabled. 2015-08-04 12:59:34 -05:00
UICommon UICommon: Fix a leak/bug in Disassembler retrieval 2015-08-04 14:28:32 -04:00
VideoBackends [GLES] Fix real XFB. 2015-08-12 17:32:05 -05:00
VideoCommon DriverDetails: Disable GL_ARB_copy_image on mesa. 2015-08-06 19:41:36 +02:00
CMakeLists.txt Merge pull request #1085 from waddlesplash/refactoring 2014-10-05 21:25:44 -04:00