mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 04:14:53 +00:00
[FREELDR] Support setting up the EBP register on INT386() entry only if EBP != 0, otherwise use it only as output.
This commit is contained in:
parent
cf64f121f2
commit
ff722ac72e
3 changed files with 9 additions and 2 deletions
|
@ -45,7 +45,6 @@ Int386:
|
||||||
sub rsp, 40
|
sub rsp, 40
|
||||||
//.ENDPROLOG
|
//.ENDPROLOG
|
||||||
|
|
||||||
int386_2:
|
|
||||||
/* Copy the int vector to shared memory */
|
/* Copy the int vector to shared memory */
|
||||||
mov dword ptr [BSS_IntVector], ecx
|
mov dword ptr [BSS_IntVector], ecx
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ Int386_return:
|
||||||
mov ecx, REGS_SIZE / 4
|
mov ecx, REGS_SIZE / 4
|
||||||
rep movsd
|
rep movsd
|
||||||
|
|
||||||
|
/* Restore all registers + segment registers */
|
||||||
popa
|
popa
|
||||||
pop gs
|
pop gs
|
||||||
pop fs
|
pop fs
|
||||||
|
|
|
@ -37,13 +37,19 @@ Int386:
|
||||||
mov ax, word ptr cs:[BSS_RegisterSet + REGS_GS]
|
mov ax, word ptr cs:[BSS_RegisterSet + REGS_GS]
|
||||||
mov gs, ax
|
mov gs, ax
|
||||||
|
|
||||||
|
/* Setup ebp only if EBP != 0, otherwise use it only as output */
|
||||||
|
mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EBP]
|
||||||
|
test eax, eax
|
||||||
|
jz Int386_set_registers
|
||||||
|
mov ebp, eax
|
||||||
|
|
||||||
|
Int386_set_registers:
|
||||||
mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EAX]
|
mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EAX]
|
||||||
mov ebx, dword ptr cs:[BSS_RegisterSet + REGS_EBX]
|
mov ebx, dword ptr cs:[BSS_RegisterSet + REGS_EBX]
|
||||||
mov ecx, dword ptr cs:[BSS_RegisterSet + REGS_ECX]
|
mov ecx, dword ptr cs:[BSS_RegisterSet + REGS_ECX]
|
||||||
mov edx, dword ptr cs:[BSS_RegisterSet + REGS_EDX]
|
mov edx, dword ptr cs:[BSS_RegisterSet + REGS_EDX]
|
||||||
mov esi, dword ptr cs:[BSS_RegisterSet + REGS_ESI]
|
mov esi, dword ptr cs:[BSS_RegisterSet + REGS_ESI]
|
||||||
mov edi, dword ptr cs:[BSS_RegisterSet + REGS_EDI]
|
mov edi, dword ptr cs:[BSS_RegisterSet + REGS_EDI]
|
||||||
// Don't setup ebp, we only use it as output!
|
|
||||||
|
|
||||||
/* Call the interrupt vector */
|
/* Call the interrupt vector */
|
||||||
/*int Int386_vector*/
|
/*int Int386_vector*/
|
||||||
|
@ -72,6 +78,7 @@ Int386_vector_opcode:
|
||||||
pushfd
|
pushfd
|
||||||
pop dword ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
|
pop dword ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
|
||||||
|
|
||||||
|
/* Restore all registers + segment registers */
|
||||||
popad
|
popad
|
||||||
pop gs
|
pop gs
|
||||||
pop fs
|
pop fs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue