STI+CLI

STI+CLI

Post by Nick Rober » Fri, 08 Aug 2003 21:17:31


[nb: cross posted]





You and Marv are quite right, and I quote from the Intel manual:

If the STI instruction is followed by a CLI instruction
(which clears the IF flag), the effect of the STI
instruction is negated.

That's typical Intel, that is. Corporate motto: We Will Find New and
Inventive Ways to Break Your Software[TM]. Presumably if we all code:

STI
NOP
CLI

next year Intel will bring out a processor on which it doesn't work!
 
 
 

STI+CLI

Post by wmr28 » Mon, 11 Aug 2003 03:25:14


I've always thought the point was to make:

while (no runnable threads) {
STI
HLT
CLI
}

work. That's what my thread switcher does when it doesn't find any
runnable threads.

If the significant interrupt happened after the STI but before the
HLT, it would hang until another interrupt came along.

Mike