1
0
Fork 0
forked from len0rd/rockbox

The cli()/sti() functions are not safe. We should have removed them long ago.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4314 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-02-25 13:00:36 +00:00
parent 34455abfe6
commit f9c780ccc1
6 changed files with 39 additions and 44 deletions

View file

@ -302,7 +302,7 @@ void (*vbr[]) (void) __attribute__ ((section (".vectors"))) =
void system_reboot (void)
{
cli ();
set_irq_level(15);
asm volatile ("ldc\t%0,vbr" : : "r"(0));
@ -318,6 +318,18 @@ void system_reboot (void)
"r"(*(int*)0),"r"(4));
}
/****************************************************************************
* Interrupt level setting
****************************************************************************/
int set_irq_level(int level)
{
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;
}
void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
{
bool state = true;