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:
Linus Nielsen Feltzing 2002-05-11 21:44:04 +00:00
parent bb69a59a97
commit e48a45a11a

View file

@ -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;
}
/****************************************************************************