Page 1 of 1

Another quick question about iretd

Posted: Fri Oct 02, 2020 10:39 pm
by clementttttttttt
What is the

Code: Select all

pop
order of iretd?

Re: Another quick question about iretd

Posted: Fri Oct 02, 2020 10:44 pm
by kzinti
ia32:

Code: Select all

struct InterruptContext
{
    ...
    // iret frame
    uint32_t eip;
    uint32_t cs;
    uint32_t eflags;
    // These are only saved/restored when crossing privilege levels
    uint32_t esp;
    uint32_t ss;
};
x86_64:

Code: Select all

struct InterruptContext
{
    ...
    // iret frame
    uint64_t rip;
    uint64_t cs;
    uint64_t rflags;
    // These are always valid (different behaviour than 32 bits mode)
    uint64_t rsp;
    uint64_t ss;
};