ReactOS  0.4.13-dev-249-gcba1a2f
gpfault.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void InstallGPFaultHook (void)
 
void DeInstallGPFaultHook (void)
 

Variables

ULONG OldGPFaultHandler
 

Function Documentation

◆ DeInstallGPFaultHook()

void DeInstallGPFaultHook ( void  )

Definition at line 126 of file gpfault.c.

127 {
128  ENTER_FUNC();
129 
130  MaskIrqs();
132  {
136  }
137  UnmaskIrqs();
138 
139  LEAVE_FUNC();
140 }
#define TRUE
Definition: types.h:120
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
Definition: hooks.c:95
#define LEAVE_FUNC()
Definition: debug.h:43
void MaskIrqs(void)
Definition: hooks.c:68
BOOLEAN RemoveAllSWBreakpoints(BOOLEAN bEvenPermanents)
Definition: bp.c:463
ULONG OldGPFaultHandler
Definition: gpfault.c:41
unsigned int ULONG
Definition: retypes.h:1
#define ENTER_FUNC()
Definition: debug.h:42
void UnmaskIrqs(void)
Definition: hooks.c:82

Referenced by CleanUpPICE().

◆ InstallGPFaultHook()

void InstallGPFaultHook ( void  )

Definition at line 102 of file gpfault.c.

103 {
104  ULONG LocalGPFaultHandler;
105 
106  ENTER_FUNC();
107 
108  MaskIrqs();
109  if(!OldGPFaultHandler)
110  {
111  __asm__("mov $NewGPFaultHandler,%0"
112  :"=r" (LocalGPFaultHandler)
113  :
114  :"eax");
115  OldGPFaultHandler=SetGlobalInt(0x0D,(ULONG)LocalGPFaultHandler);
116  }
117  UnmaskIrqs();
118 
119  LEAVE_FUNC();
120 }
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
Definition: hooks.c:95
#define LEAVE_FUNC()
Definition: debug.h:43
void MaskIrqs(void)
Definition: hooks.c:68
__asm__("\n\t \ NewGPFaultHandler:\n\t \ pushfl\n\t \ cli\n\t \ cld\n\t \ pushal\n\t \ pushl %ds\n\t \ \n\t \ // test for v86 mode\n\t \ testl $0x20000,40(%esp)\n\t \ jnz notv86\n\t \ popl %ds\n\t \ popal\n\t \ popfl\n\t \ .byte 0x2e\n\t \ jmp *_OldGPFaultHandler\n\t \ notv86:\n\t \ // setup default data selectors\n\t \ movw %ss,%ax\n\t \ movw %ax,%ds\n\t \ \n\t \ // get frame ptr\n\t \ lea 40(%esp),%eax\n\t \ pushl %eax\n\t \ call _HandleGPFault\n\t \ addl $4,%esp\n\t \ \n \t \ popl %ds\n\t \ popal\n\t \ popfl\n\t \ // remove error code from stack and replace with reason code\n\t \ movl $" STR(REASON_GP_FAULT) ",(%esp)\n\t \ // call debugger loop\n\t \ jmp NewInt31Handler\n\t \ ")
ULONG OldGPFaultHandler
Definition: gpfault.c:41
unsigned int ULONG
Definition: retypes.h:1
#define ENTER_FUNC()
Definition: debug.h:42
void UnmaskIrqs(void)
Definition: hooks.c:82

Referenced by InitPICE().

Variable Documentation

◆ OldGPFaultHandler

ULONG OldGPFaultHandler

Definition at line 41 of file gpfault.c.

Referenced by DeInstallGPFaultHook(), and InstallGPFaultHook().