ReactOS  0.4.13-dev-544-gede3fdd
dblflt.c File Reference
#include "remods.h"
#include "precomp.h"
Include dependency graph for dblflt.c:

Go to the source code of this file.

Functions

void HandleDoubleFault (FRAME *ptr)
 
 __asm__ (" \ NewDblFltHandler:\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 \ // get frame ptr\n\t \ lea 40(%esp),%eax\n\t \ pushl %eax\n\t \ call _HandleDoubleFault\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_DOUBLE_FAULT) ",(%esp)\n\t \ // call debugger loop\n\t \ jmp NewInt31Handler\n\t")
 
void InstallDblFltHook (void)
 
void DeInstallDblFltHook (void)
 

Variables

ULONG OldDblFltHandler = 0
 

Function Documentation

◆ __asm__()

__asm__ ( " \NewDblFltHandler:\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 \//get frame ptr\n\t \ lea   40%esp,
%eax\n\t \ pushl %eax\n\t \ call _HandleDoubleFault\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_DOUBLE_FAULT) "  ,
(%esp)\n\t \//call debugger loop\n\t \ jmp NewInt31Handler\n\t  
)

Referenced by InstallDblFltHook().

◆ DeInstallDblFltHook()

void DeInstallDblFltHook ( void  )

Definition at line 117 of file dblflt.c.

118 {
119  ENTER_FUNC();
120 
121  MaskIrqs();
122  if(OldDblFltHandler)
123  {
127  }
128  UnmaskIrqs();
129 
130  LEAVE_FUNC();
131 }
#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
ULONG OldDblFltHandler
Definition: dblflt.c:42
BOOLEAN RemoveAllSWBreakpoints(BOOLEAN bEvenPermanents)
Definition: bp.c:463
unsigned int ULONG
Definition: retypes.h:1
#define ENTER_FUNC()
Definition: debug.h:42
void UnmaskIrqs(void)
Definition: hooks.c:82

Referenced by CleanUpPICE().

◆ HandleDoubleFault()

void HandleDoubleFault ( FRAME ptr)

Definition at line 52 of file dblflt.c.

53 {
54  DPRINT((0,"HandleDoubleFault(): ptr = %x\n",ptr));
55 }
static PVOID ptr
Definition: dispmode.c:27
void DPRINT(...)
Definition: polytest.cpp:61

◆ InstallDblFltHook()

void InstallDblFltHook ( void  )

Definition at line 93 of file dblflt.c.

94 {
95  ULONG LocalDblFltHandler;
96 
97  ENTER_FUNC();
98 
99  MaskIrqs();
100  if(!OldDblFltHandler)
101  {
102  __asm__("mov $NewDblFltHandler,%0"
103  :"=r" (LocalDblFltHandler)
104  :
105  :"eax");
106  OldDblFltHandler=SetGlobalInt(0x08,(ULONG)LocalDblFltHandler);
107  }
108  UnmaskIrqs();
109 
110  LEAVE_FUNC();
111 }
ULONG SetGlobalInt(ULONG dwInt, ULONG NewIntHandler)
Definition: hooks.c:95
#define LEAVE_FUNC()
Definition: debug.h:43
void MaskIrqs(void)
Definition: hooks.c:68
ULONG OldDblFltHandler
Definition: dblflt.c:42
__asm__(" \ NewDblFltHandler:\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 \ // get frame ptr\n\t \ lea 40(%esp),%eax\n\t \ pushl %eax\n\t \ call _HandleDoubleFault\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_DOUBLE_FAULT) ",(%esp)\n\t \ // call debugger loop\n\t \ jmp NewInt31Handler\n\t")
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

◆ OldDblFltHandler

ULONG OldDblFltHandler = 0

Definition at line 42 of file dblflt.c.

Referenced by DeInstallDblFltHook(), and InstallDblFltHook().