marking a function dirty (specifying that caller should save all registers)
<p>I have a function <code>f()</code> that destroys all registers across the function call, except the stack pointer. How can I convey this to <code>gcc</code>, so that the caller will save all registers it wants to save, before calling <code>f()</code>?</p>

<p>EDIT:
I'm writing a coroutine handler, which needs to save state before switching to another coroutine and I'd like to save the minimum state possible. Say we have a function <code>yield()</code>, marked as "dirty", destroying everything except the stack pointer. This function will magically return after control returns to our coroutine, but it would be best if the caller, not the callee (since the caller knows best which registers it needs saved) would save all registers it needs to save before calling <code>yield()</code> and then restore them afterwards.</p>