32x, drc, fix saving SH2 SR in dma

This commit is contained in:
kub 2021-05-11 22:05:57 +02:00
parent 78c2237ab8
commit ca1b77e601
3 changed files with 9 additions and 4 deletions

View file

@ -70,12 +70,13 @@ extern void REGPARM(1) (*sh2_drc_restore_sr)(SH2 *sh2);
#else
#define DRC_DECLARE_SR register long _sh2_sr asm(DRC_SR_REG)
#endif
// NB: save/load SR register only when DRC is executing and not in DMA access
#define DRC_SAVE_SR(sh2) \
if (likely(sh2->state & SH2_IN_DRC)) \
if (likely((sh2->state & (SH2_IN_DRC|SH2_STATE_SLEEP)) == SH2_IN_DRC)) \
sh2->sr = (s32)_sh2_sr
// sh2_drc_save_sr(sh2)
#define DRC_RESTORE_SR(sh2) \
if (likely(sh2->state & SH2_IN_DRC)) \
if (likely((sh2->state & (SH2_IN_DRC|SH2_STATE_SLEEP)) == SH2_IN_DRC)) \
_sh2_sr = (s32)sh2->sr
// sh2_drc_restore_sr(sh2)
#else