1
0
Fork 0
forked from len0rd/rockbox

Made set_irq_level() an inline function, and optimized it by removing the bit shifts

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4330 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-03-02 11:32:59 +00:00
parent aa5b23d616
commit 111a972b65
8 changed files with 25 additions and 22 deletions

View file

@ -25,7 +25,6 @@
extern void system_reboot (void);
extern void system_init(void);
extern int set_irq_level(int level);
#define FREQ CPU_FREQ
#define BAUDRATE 9600
@ -73,6 +72,20 @@ extern int set_irq_level(int level);
#ifndef SIMULATOR
/****************************************************************************
* Interrupt level setting
* The level is left shifted 4 bits
****************************************************************************/
#define HIGHEST_IRQ_LEVEL (15<<4)
static inline 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));
return i;
}
static inline short SWAB16(short value)
/*
result[15..8] = value[ 7..0];