mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -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
|
|
@ -66,27 +66,27 @@ static void _pcm_apply_settings(void)
|
|||
|
||||
void pcm_apply_settings(void)
|
||||
{
|
||||
int oldstatus = set_fiq_status(FIQ_DISABLED);
|
||||
int status = disable_fiq_save();
|
||||
_pcm_apply_settings();
|
||||
set_fiq_status(oldstatus);
|
||||
restore_fiq(status);
|
||||
}
|
||||
|
||||
/* For the locks, DMA interrupt must be disabled because the handler
|
||||
manipulates INTMSK and the operation is not atomic */
|
||||
void pcm_play_lock(void)
|
||||
{
|
||||
int status = set_fiq_status(FIQ_DISABLED);
|
||||
int status = disable_fiq_save();
|
||||
if (++dma_play_lock.locked == 1)
|
||||
INTMSK |= (1<<19); /* Mask the DMA interrupt */
|
||||
set_fiq_status(status);
|
||||
restore_fiq(status);
|
||||
}
|
||||
|
||||
void pcm_play_unlock(void)
|
||||
{
|
||||
int status = set_fiq_status(FIQ_DISABLED);
|
||||
int status = disable_fiq_save();
|
||||
if (--dma_play_lock.locked == 0)
|
||||
INTMSK &= ~dma_play_lock.state; /* Unmask the DMA interrupt if enabled */
|
||||
set_fiq_status(status);
|
||||
restore_fiq(status);
|
||||
}
|
||||
|
||||
void pcm_play_dma_init(void)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ bool __timer_set(long cycles, bool start)
|
|||
pfn_unregister = NULL;
|
||||
}
|
||||
|
||||
oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
oldlevel = disable_irq_save();
|
||||
|
||||
TCMPB0 = 0;
|
||||
TCNTB0 = (unsigned int)cycles / prescaler;
|
||||
|
|
@ -77,7 +77,7 @@ bool __timer_set(long cycles, bool start)
|
|||
TCFG0 = (TCFG0 & ~0xff) | (prescaler - 1);
|
||||
TCFG1 = (TCFG1 & ~0xf) | divider;
|
||||
|
||||
set_irq_level(oldlevel);
|
||||
restore_irq(oldlevel);
|
||||
|
||||
retval = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue