Jeremy Fitzhardinge wrote: > Rusty Russell wrote: > >> Absolutely. I didn't know how much room the replacements would need, so >> I chose this "no-clobber" approach which takes 12 bytes. If it turns >> out that is too much, we can change to a clobber. If it turns out to be >> too little, we'll need to noop pad and/or clobber. >> >> > > Seems to me that clobbering + padding is the neatest combination. > > >> For the cases where these are used in asm directly (currently cli and >> sti replacement), it was simplest to save all regs to have to same >> non-clobber properties as the raw insns. >> >> > > Yes, particularly since their inlined implementation probably won't need > many registers. > We don't use or destroy any registers in our implementation of these, not even eax (except of course, when returning the interrupt flag). We didn't inline these, since at least restore flags and sti() must check for and fire pending interrupts, which requires branches, and inlining branches gets a bit complicated. Zach