mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-21 19:12:39 -05:00
Do core interrupt masking in a less general fashion and save some instructions to decrease size and speed things up a little bit. Small fix to a few places where interrupts would get enabled again where they shouldn't have been (context switching calls when disabled).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16811 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
74d678fdbc
commit
af395f4db6
61 changed files with 381 additions and 278 deletions
|
|
@ -417,7 +417,7 @@ static bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
|
|||
not_id = flash[1]; /* should be 'A' (0x41) and 'R' (0x52) from the "ARCH" marker */
|
||||
|
||||
/* disable interrupts, prevent any stray flash access */
|
||||
old_level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
old_level = disable_irq_save();
|
||||
|
||||
flash[addr1] = 0xAA; /* enter command mode */
|
||||
flash[addr2] = 0x55;
|
||||
|
|
@ -432,7 +432,7 @@ static bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
|
|||
/* Atmel wants 20ms pause here */
|
||||
/* sleep(HZ/50); no sleeping possible while interrupts are disabled */
|
||||
|
||||
set_irq_level(old_level); /* enable interrupts again */
|
||||
restore_irq(old_level); /* enable interrupts again */
|
||||
|
||||
/* I assume success if the obtained values are different from
|
||||
the normal flash content. This is not perfectly bulletproof, they
|
||||
|
|
@ -2066,9 +2066,12 @@ static bool dbg_save_roms(void)
|
|||
char buf[EEPROM_SIZE];
|
||||
int err;
|
||||
|
||||
old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
old_irq_level = disable_irq_save();
|
||||
|
||||
err = eeprom_24cxx_read(0, buf, sizeof buf);
|
||||
|
||||
restore_irq(old_irq_level);
|
||||
|
||||
if (err)
|
||||
gui_syncsplash(HZ*3, "Eeprom read failure (%d)",err);
|
||||
else
|
||||
|
|
@ -2076,8 +2079,6 @@ static bool dbg_save_roms(void)
|
|||
write(fd, buf, sizeof buf);
|
||||
}
|
||||
|
||||
set_irq_level(old_irq_level);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -2248,7 +2249,7 @@ static bool dbg_write_eeprom(void)
|
|||
|
||||
if(rc == EEPROM_SIZE)
|
||||
{
|
||||
old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
old_irq_level = disable_irq_save();
|
||||
|
||||
err = eeprom_24cxx_write(0, buf, sizeof buf);
|
||||
if (err)
|
||||
|
|
@ -2256,7 +2257,7 @@ static bool dbg_write_eeprom(void)
|
|||
else
|
||||
gui_syncsplash(HZ*3, "Eeprom written successfully");
|
||||
|
||||
set_irq_level(old_irq_level);
|
||||
restore_irq(old_irq_level);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ static void init(void)
|
|||
{
|
||||
kernel_init();
|
||||
buffer_init();
|
||||
set_irq_level(0);
|
||||
enable_irq();
|
||||
lcd_init();
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
lcd_remote_init();
|
||||
|
|
@ -360,9 +360,9 @@ static void init(void)
|
|||
|
||||
power_init();
|
||||
|
||||
set_irq_level(0);
|
||||
enable_irq();
|
||||
#ifdef CPU_ARM
|
||||
set_fiq_status(FIQ_ENABLED);
|
||||
enable_fiq();
|
||||
#endif
|
||||
lcd_init();
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
|
|
|
|||
|
|
@ -3345,7 +3345,7 @@ void dma_end_isr(void)
|
|||
|
||||
void demand_irq_enable(bool on)
|
||||
{
|
||||
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
int oldlevel = disable_irq_save();
|
||||
|
||||
if(on)
|
||||
{
|
||||
|
|
@ -3357,7 +3357,7 @@ void demand_irq_enable(bool on)
|
|||
IPRA &= 0xfff0;
|
||||
}
|
||||
|
||||
set_irq_level(oldlevel);
|
||||
restore_irq(oldlevel);
|
||||
}
|
||||
|
||||
static inline int available(void)
|
||||
|
|
|
|||
|
|
@ -3415,7 +3415,7 @@ void rec_tick(void)
|
|||
|
||||
void rec_tick_enable(bool on)
|
||||
{
|
||||
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
int oldlevel = disable_irq_save();
|
||||
|
||||
if(on)
|
||||
{
|
||||
|
|
@ -3431,7 +3431,7 @@ void rec_tick_enable(bool on)
|
|||
IPRB = (IPRB & 0xff0f) | 0x0080; /* Reenable IRQ6 */
|
||||
}
|
||||
|
||||
set_irq_level(oldlevel);
|
||||
restore_irq(oldlevel);
|
||||
}
|
||||
|
||||
void hijack_interrupts(bool on)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue