1
0
Fork 0
forked from len0rd/rockbox

Modification to scale_suspend_core to prevent a potential permanent freezing of the other core. Just unfreeze it unconditionally after freezing it since it really makes no difference to do so right now. Don't bother with freezing/unfreezing if compiling as single.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16731 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-03-21 17:20:57 +00:00
parent 5af25c46e3
commit f65cf301fb

View file

@ -144,22 +144,19 @@ void scale_suspend_core(bool suspend) ICODE_ATTR;
void scale_suspend_core(bool suspend) void scale_suspend_core(bool suspend)
{ {
unsigned int core = CURRENT_CORE; unsigned int core = CURRENT_CORE;
unsigned int othercore = 1 - core; IF_COP( unsigned int othercore = 1 - core; )
static unsigned long proc_bits IBSS_ATTR;
static int oldstatus IBSS_ATTR; static int oldstatus IBSS_ATTR;
if (suspend) if (suspend)
{ {
oldstatus = set_interrupt_status(IRQ_FIQ_DISABLED, IRQ_FIQ_STATUS); oldstatus = set_interrupt_status(IRQ_FIQ_DISABLED, IRQ_FIQ_STATUS);
proc_bits = PROC_CTL(othercore) & 0xc0000000; IF_COP( PROC_CTL(othercore) = 0x40000000; nop; )
PROC_CTL(othercore) = 0x40000000; nop;
PROC_CTL(core) = 0x48000003; nop; PROC_CTL(core) = 0x48000003; nop;
} }
else else
{ {
PROC_CTL(core) = 0x4800001f; nop; PROC_CTL(core) = 0x4800001f; nop;
if (proc_bits == 0) IF_COP( PROC_CTL(othercore) = 0x00000000; nop; )
PROC_CTL(othercore) = 0;
set_interrupt_status(oldstatus, IRQ_FIQ_STATUS); set_interrupt_status(oldstatus, IRQ_FIQ_STATUS);
} }
} }