small error in the exceptions

Feedback? Questions? Comments? All discussions on the articles and tutorials hosted or developed by us go in here.

Moderator:Moderators

accelleon
Posts:15
Joined:Mon Dec 07, 2009 3:41 am
small error in the exceptions

Post by accelleon » Sat Jan 22, 2011 9:24 pm

Large Edit:

according to the Intel Manual Volume 3A, Chapter 6, Section 12.1, Figure 6-4:
if the privilege level doesn't change (meaning the exception happened in CPL 0) the stack is:
  • EFLAGS
    CS
    EIP
    Error Code
so the parameter definitions should be according to the cdecl calling convention

Code: Select all

(unsigned int err, unsigned int eip, unsigned int cs, unsigned int eflags)
and
(unsigned int eip, unsigned int cs, unsigned int eflags)
not

Code: Select all

(unsigned int cs,unsigned int err,  unsigned int eip, unsigned int eflags)
and
(unsigned int cs, unsigned int eip, unsigned int eflags)
and in the event of a privilege level change (CPL 3 and interrupt's DPL is 0) the handler's stack is:
  • SS
    ESP
    EFLAGS
    CS
    EIP
    Error Code
and the interrupted procedure's stack is left unchanged

Post Reply