I am working on multithreading, and I am wondering what
exactly an IRET does.
While I know that it pops cs, eip, and eflags off the stack, the struct that I borrowed for my interrupt handler has 2 more value: ss and esp. Do these also get popped off during an IRET? and if they do, does the interrupt always push them?
Confused.
Here is my struct (I pass a pointer to it every interrupt):
Code: Select all
struct x86_registers
{
uint32_t gs, fs, es, ds;
uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
uint32_t int_no, err_code;
uint32_t eip, cs, eflags, useresp, ss;
};
However, I have some simple code running that (for now) dumps the registers of the interrupted process on every interrupt. while the 'esp' value seems to correspond to a sane esp, 'useresp' has all sorts of odd values, even settling in at zero sometimes. Also, I read that popa doesn't pop esp. therefore, is the esp pushed by pusha valid?
EDIT: Here is a screenshot of registers:
Thank you!
"Out of memory: Please memorize the following numbers and type them back in when asked for page number 42". - linguofreak
"Quote me in your forum signature" - Sortie (Check!)