Re: Software task switch - interrupted ISR
Posted: Mon Jun 04, 2012 3:52 am
Not quite, because even if an IRQ is running too long with interrupts enabled, you might just as well lose interrupts. The only difference is that they have to be of a lower privilege. You don't want for instance your mouse to randomly stop working because of a design issue like that.suslik wrote:OK, I think to make something like this: (...) is not good, since when ISR is time consuming I lose some timer interrupts
Read-modify-write operations are not atomic respective to other logical cores without the bus lock, and add/sub are no different than inc/dec (only xchg is atomic without lock due to history). The IRQ nesting counter is per kernel stack. Other processor cores have no business modifying other cores' counter so a lock is not necessary.Also, I don't remember exactly, but add/sub instr-s don't have implicit lock. Why not inc/dec?
Interrupt gates are for when you need to run some code uninterrupted before it is safe to nest other IRQs. That is not the same as "always"Regardless of design, you should always use interrupt gates.
That's absolutely not true.rdos wrote:Because inc/dec don't update flags.