Another quick question about iretd

Programming, for all ages and all languages.
Post Reply
clementttttttttt
Member
Member
Posts: 70
Joined: Tue Jul 14, 2020 4:01 am
Libera.chat IRC: clementttttttttt

Another quick question about iretd

Post by clementttttttttt »

What is the

Code: Select all

pop
order of iretd?
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: Another quick question about iretd

Post 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;
};
Post Reply