Go to the source code of this file.
◆ DeInstallIntEHook()
Definition at line 389 of file pgflt.c.
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
Referenced by CleanUpPICE().
◆ InstallIntEHook()
Definition at line 365 of file pgflt.c.
367 ULONG LocalIntEHandler;
374 __asm__ __volatile__(
"mov $NewIntEHandler,%0" 375 :
"=r" (LocalIntEHandler)
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
__asm__("\n\t \
NewIntEHandler:\n\t \
pushfl\n\t \
cli\n\t \
cld\n\t \
pushal\n\t \
pushl %ds\n\t \
\n\t \
// setup default data selectors\n\t \
movw %ss,%ax\n\t \
movw %ax,%ds\n\t \
\n\t \
/*\n\t \
* Load the PCR selector.\n\t \
*/\n\t \
movl %fs, %eax\n\t \
movl %eax, _OLD_PCR\n\t \
movl _PCR_SEL, %eax\n\t \
movl %eax, %fs\n\t \
\n\t \
// get frame ptr\n\t \
lea 40(%esp),%eax\n\t \
pushl %eax\n\t \
call _HandlePageFault\n\t \
addl $4,%esp\n\t \
\n\t \
pushl %eax\n\t \
movl _OLD_PCR, %eax\n\t \
movl %eax, %fs\n\t \
popl %eax\n\t \
\n\t \
cmpl $0,%eax\n\t \
je call_old_inte_handler\n\t \
\n\t \
cmpl $2,%eax\n\t \
je call_handler_unknown_reason\n\t \
\n\t \
popl %ds\n\t \
popal\n\t \
popfl\n\t \
// remove error code. will be restored later when we call\n\t \
// original handler again.\n\t \
addl $4,%esp\n\t \
// call debugger loop\n\t \
pushl $" STR(REASON_PAGEFAULT) "\n\t \
jmp NewInt31Handler\n\t \
\n\t \
call_old_inte_handler:\n\t \
popl %ds\n\t \
popal\n\t \
popfl\n\t \
// chain to old handler\n\t \
.byte 0x2e\n\t \
jmp *_OldIntEHandler\n\t \
\n\t \
call_handler_unknown_reason:\n\t \
popl %ds\n\t \
popal\n\t \
popfl\n\t \
// remove error code. will be restored later when we call\n\t \
// original handler again.\n\t \
addl $4,%esp\n\t \
// call debugger loop\n\t \
pushl $" STR(REASON_INTERNAL_ERROR) "\n\t \
jmp NewInt31Handler\n\t \
")
Referenced by InitPICE().
◆ error_code