ReactOS  0.4.15-dev-1184-g23e04ae
nmidebug.c File Reference
#include <ntifs.h>
#include <ndk/ketypes.h>
Include dependency graph for nmidebug.c:

Go to the source code of this file.

Functions

FORCEINLINE VOID NmiClearFlag (VOID)
 
BOOLEAN NTAPI NmiDbgCallback (IN PVOID Context, IN BOOLEAN Handled)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 

Variables

PCHAR NmiBegin = "NMI4NMI@"
 

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 57 of file nmidebug.c.

59 {
60  PAGED_CODE();
61 
62  /* Register NMI callback */
64 
65  /* Return success */
66  return STATUS_SUCCESS;
67 }
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN NTAPI NmiDbgCallback(IN PVOID Context, IN BOOLEAN Handled)
Definition: nmidebug.c:38
PVOID NTAPI KeRegisterNmiCallback(IN PNMI_CALLBACK CallbackRoutine, IN PVOID Context)
Definition: bug.c:1331
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define PAGED_CODE()

◆ NmiClearFlag()

FORCEINLINE VOID NmiClearFlag ( VOID  )

Definition at line 20 of file nmidebug.c.

21 {
22  ((PCHAR)&KiBugCheckData[4])[0] -= (NmiBegin[3] | NmiBegin[7]);
23  ((PCHAR)&KiBugCheckData[4])[3] |= 1;
24 #ifdef _M_IX86
25 #if defined(_MSC_VER) && !defined(__clang__)
26  __asm
27  {
28  rcr KiBugCheckData[4], 8
29  }
30 #else
31  __asm__("rcrl %b[shift], %k[retval]" : [retval] "=rm" (KiBugCheckData[4]) : "[retval]" (KiBugCheckData[4]), [shift] "Nc" (8));
32 #endif
33 #endif
34 }
#define shift
Definition: input.c:1756
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
#define PCHAR
Definition: match.c:90
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
PCHAR NmiBegin
Definition: nmidebug.c:16

Referenced by NmiDbgCallback().

◆ NmiDbgCallback()

BOOLEAN NTAPI NmiDbgCallback ( IN PVOID  Context,
IN BOOLEAN  Handled 
)

Definition at line 38 of file nmidebug.c.

40 {
41  /* Clear the NMI flag */
42  NmiClearFlag();
43 
44  /* Get NMI status signature */
45  __indwordstring(0x80, (PULONG)NmiBegin, 1);
46  ((void(*)())&KiBugCheckData[4])();
47 
48  /* Handle the NMI safely */
49 #ifdef _M_IX86
51 #endif
52  return TRUE;
53 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define TRUE
Definition: types.h:120
BOOLEAN KiEnableTimerWatchdog
Definition: timerobj.c:20
FORCEINLINE VOID NmiClearFlag(VOID)
Definition: nmidebug.c:20
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
PPC_QUAL void __indwordstring(unsigned long Port, unsigned long *Buffer, unsigned long Count)
Definition: intrin_ppc.h:598
PCHAR NmiBegin
Definition: nmidebug.c:16
unsigned int * PULONG
Definition: retypes.h:1
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465

Referenced by DriverEntry().

Variable Documentation

◆ NmiBegin

PCHAR NmiBegin = "NMI4NMI@"

Definition at line 16 of file nmidebug.c.

Referenced by NmiClearFlag(), and NmiDbgCallback().