The set_irq_level function was braindead
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@545 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bb69a59a97
commit
e48a45a11a
1 changed files with 5 additions and 13 deletions
|
@ -53,21 +53,13 @@ void yield(void)
|
|||
/****************************************************************************
|
||||
* Interrupt level setting
|
||||
****************************************************************************/
|
||||
static int current_irq_level = 15;
|
||||
|
||||
int set_irq_level(int level)
|
||||
{
|
||||
int old;
|
||||
|
||||
/* First raise to highest level and update the shadow */
|
||||
asm volatile ("ldc %0, sr" : : "r" (15<<4));
|
||||
old = current_irq_level;
|
||||
current_irq_level = level;
|
||||
|
||||
/* Then set the wanted level */
|
||||
asm volatile ("ldc %0, sr" : : "r" ((unsigned int)level<<4));
|
||||
|
||||
return ((unsigned int)old >> 4) & 0x0f;
|
||||
int i;
|
||||
/* Read the old level and set the new one */
|
||||
asm volatile ("stc sr, %0" : "=r" (i));
|
||||
asm volatile ("ldc %0, sr" : : "r" (level << 4));
|
||||
return (i >> 4) & 0x0f;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue