Rockbox mail archive
Subject: Re: Various bug fixes and improvements - where to put?
From: Linus Nielsen Feltzing (linus_at_haxx.se)
Date: 2004-03-02
[IDC]Dragon wrote:
>>I don't understand what the intention in replacing cli() / sti()
>>by set_irq_level() really is. The comment says that cli() / sti()
>>are not safe.
>
>
> I didn't understand this either, and it seems I have not yet compiled this
> into the version I'm running, else I may have noticed the drag.
> They should be inline functions.
Yes, they should be inline.
The reason that cli()/sti() was unsafe is because they disregarded the
current interrupt level. The sti() function always set the interrupt
level to 0, which is a disaster if called from an interrupt, or when the
interrupt is already disabled, like when you nest the calls.
Linus
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Page was last modified "Jan 10 2012" The Rockbox Crew
|