ReactOS 0.4.15-dev-8116-gf69e256
nmidebug.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS NMI Debug Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/base/nmidebug/nmidebug.c
5 * PURPOSE: Driver Code
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <ntifs.h>
12#include <ndk/ketypes.h>
13
14/* FUNCTIONS ******************************************************************/
15
16PCHAR NmiBegin = "NMI4NMI@";
17
19VOID
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}
35
40{
41 /* Clear the NMI flag */
43
44 /* Get NMI status signature */
46 ((void(*)())&KiBugCheckData[4])();
47
48 /* Handle the NMI safely */
49#ifdef _M_IX86
51#endif
52 return TRUE;
53}
54
59{
60 PAGED_CODE();
61
62 /* Register NMI callback */
64
65 /* Return success */
66 return STATUS_SUCCESS;
67}
68
69/* EOF */
#define PAGED_CODE()
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
PVOID NTAPI KeRegisterNmiCallback(IN PNMI_CALLBACK CallbackRoutine, IN PVOID Context)
Definition: bug.c:1330
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
PPC_QUAL void __indwordstring(unsigned long Port, unsigned long *Buffer, unsigned long Count)
Definition: intrin_ppc.h:598
#define PCHAR
Definition: match.c:90
#define shift
Definition: input.c:1755
PCHAR NmiBegin
Definition: nmidebug.c:16
BOOLEAN NTAPI NmiDbgCallback(IN PVOID Context, IN BOOLEAN Handled)
Definition: nmidebug.c:38
FORCEINLINE VOID NmiClearFlag(VOID)
Definition: nmidebug.c:20
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
#define STATUS_SUCCESS
Definition: shellext.h:65
BOOLEAN KiEnableTimerWatchdog
Definition: timerobj.c:20
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define FORCEINLINE
Definition: wdftypes.h:67
_In_ BOOLEAN Handled
Definition: ketypes.h:349