i386 - Fix for exceptions that require the return address to point to the instruction at fault. [Barry Rodewald]
This commit is contained in:
parent
943251771c
commit
bf4eca4e2e
@ -295,7 +295,10 @@ static void i386_trap(i386_state *cpustate,int irq, int irq_gate)
|
|||||||
/* 16-bit */
|
/* 16-bit */
|
||||||
PUSH16(cpustate, get_flags(cpustate) & 0xffff );
|
PUSH16(cpustate, get_flags(cpustate) & 0xffff );
|
||||||
PUSH16(cpustate, cpustate->sreg[CS].selector );
|
PUSH16(cpustate, cpustate->sreg[CS].selector );
|
||||||
PUSH16(cpustate, cpustate->eip );
|
if(irq == 3 || irq == 4 || irq == 9 || irq_gate == 1)
|
||||||
|
PUSH16(cpustate, cpustate->eip );
|
||||||
|
else
|
||||||
|
PUSH16(cpustate, cpustate->prev_eip );
|
||||||
|
|
||||||
cpustate->sreg[CS].selector = READ16(cpustate, cpustate->idtr.base + entry + 2 );
|
cpustate->sreg[CS].selector = READ16(cpustate, cpustate->idtr.base + entry + 2 );
|
||||||
cpustate->eip = READ16(cpustate, cpustate->idtr.base + entry );
|
cpustate->eip = READ16(cpustate, cpustate->idtr.base + entry );
|
||||||
@ -325,13 +328,19 @@ static void i386_trap(i386_state *cpustate,int irq, int irq_gate)
|
|||||||
{
|
{
|
||||||
PUSH16(cpustate, get_flags(cpustate) & 0xffff );
|
PUSH16(cpustate, get_flags(cpustate) & 0xffff );
|
||||||
PUSH16(cpustate, cpustate->sreg[CS].selector );
|
PUSH16(cpustate, cpustate->sreg[CS].selector );
|
||||||
PUSH16(cpustate, cpustate->eip );
|
if(irq == 3 || irq == 4 || irq == 9 || irq_gate == 1)
|
||||||
|
PUSH16(cpustate, cpustate->eip );
|
||||||
|
else
|
||||||
|
PUSH16(cpustate, cpustate->prev_eip );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PUSH32(cpustate, get_flags(cpustate) & 0x00fcffff );
|
PUSH32(cpustate, get_flags(cpustate) & 0x00fcffff );
|
||||||
PUSH32(cpustate, cpustate->sreg[CS].selector );
|
PUSH32(cpustate, cpustate->sreg[CS].selector );
|
||||||
PUSH32(cpustate, cpustate->eip );
|
if(irq == 3 || irq == 4 || irq == 9 || irq_gate == 1)
|
||||||
|
PUSH32(cpustate, cpustate->eip );
|
||||||
|
else
|
||||||
|
PUSH32(cpustate, cpustate->prev_eip );
|
||||||
}
|
}
|
||||||
|
|
||||||
cpustate->sreg[CS].selector = segment;
|
cpustate->sreg[CS].selector = segment;
|
||||||
|
Loading…
Reference in New Issue
Block a user