ReactOS  0.4.14-dev-41-g31d7680
kdio.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: ntoskrnl/kd/kdio.c
5  * PURPOSE: NT Kernel Debugger Input/Output Functions
6  *
7  * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
8  */
9 
10 /* INCLUDES ******************************************************************/
11 
12 #include <ntoskrnl.h>
13 #include <reactos/buildno.h>
14 #define NDEBUG
15 #include <debug.h>
16 
17 /* GLOBALS *******************************************************************/
18 
19 #define KdpBufferSize (1024 * 512)
23 volatile ULONG KdpFreeBytes = 0;
27 ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log");
28 
32 
33 /* Current Port in use. FIXME: Do we support more then one? */
35 
36 #define KdpScreenLineLengthDefault 80
39 
40 const ULONG KdpDmesgBufferSize = 128 * 1024; // 512*1024; // 5*1024*1024;
43 volatile ULONG KdpDmesgFreeBytes = 0;
47 
48 /* UTILITY FUNCTIONS *********************************************************/
49 
50 /*
51  * Get the total size of the memory before
52  * Mm is initialized, by counting the number
53  * of physical pages. Useful for debug logging.
54  *
55  * Strongly inspired by:
56  * mm\ARM3\mminit.c : MiScanMemoryDescriptors(...)
57  *
58  * See also: kd64\kdinit.c
59  */
60 static SIZE_T
61 INIT_FUNCTION
63 {
64  PLIST_ENTRY ListEntry;
66  SIZE_T NumberOfPhysicalPages = 0;
67 
68  /* Loop the memory descriptors */
69  for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink;
70  ListEntry != &LoaderBlock->MemoryDescriptorListHead;
71  ListEntry = ListEntry->Flink)
72  {
73  /* Get the descriptor */
74  Descriptor = CONTAINING_RECORD(ListEntry,
76  ListEntry);
77 
78  /* Check if this is invisible memory */
79  if ((Descriptor->MemoryType == LoaderFirmwarePermanent) ||
80  (Descriptor->MemoryType == LoaderSpecialMemory) ||
81  (Descriptor->MemoryType == LoaderHALCachedMemory) ||
82  (Descriptor->MemoryType == LoaderBBTMemory))
83  {
84  /* Skip this descriptor */
85  continue;
86  }
87 
88  /* Check if this is bad memory */
89  if (Descriptor->MemoryType != LoaderBad)
90  {
91  /* Count this in the total of pages */
92  NumberOfPhysicalPages += Descriptor->PageCount;
93  }
94  }
95 
96  /* Round size up. Assumed to better match actual physical RAM size */
97  return ALIGN_UP_BY(NumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
98 }
99 
100 /* See also: kd64\kdinit.c */
101 static VOID
102 INIT_FUNCTION
104 {
105  DPRINT1("-----------------------------------------------------\n");
106  DPRINT1("ReactOS " KERNEL_VERSION_STR " (Build " KERNEL_VERSION_BUILD_STR ") (Commit " KERNEL_VERSION_COMMIT_HASH ")\n");
107  DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs);
108  DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions);
110 }
111 
112 /* FILE DEBUG LOG FUNCTIONS **************************************************/
113 
114 VOID
115 NTAPI
117 {
118  ULONG beg, end, num;
120 
122 
123  while (TRUE)
124  {
126 
127  /* Bug */
128  /* Keep KdpCurrentPosition and KdpFreeBytes values in local
129  * variables to avoid their possible change from Producer part,
130  * KdpPrintToLogFile function
131  */
133  num = KdpFreeBytes;
134 
135  /* Now securely calculate values, based on local variables */
136  beg = (end + num) % KdpBufferSize;
137  num = KdpBufferSize - num;
138 
139  /* Nothing to do? */
140  if (num == 0)
141  continue;
142 
143  if (end > beg)
144  {
146  KdpDebugBuffer + beg, num, NULL, NULL);
147  }
148  else
149  {
151  KdpDebugBuffer + beg, KdpBufferSize - beg, NULL, NULL);
152 
155  }
156 
158  }
159 }
160 
161 VOID
162 NTAPI
164  ULONG StringLength)
165 {
166  ULONG beg, end, num;
167  KIRQL OldIrql;
168 
169  if (KdpDebugBuffer == NULL) return;
170 
171  /* Acquire the printing spinlock without waiting at raised IRQL */
172  while (TRUE)
173  {
174  /* Wait when the spinlock becomes available */
176 
177  /* Spinlock was free, raise IRQL */
179 
180  /* Try to get the spinlock */
182  break;
183 
184  /* Someone else got the spinlock, lower IRQL back */
186  }
187 
188  beg = KdpCurrentPosition;
189  num = KdpFreeBytes;
190  if (StringLength < num)
191  num = StringLength;
192 
193  if (num != 0)
194  {
195  end = (beg + num) % KdpBufferSize;
197  KdpFreeBytes -= num;
198 
199  if (end > beg)
200  {
202  }
203  else
204  {
207  }
208  }
209 
210  /* Release spinlock */
212 
213  /* Lower IRQL */
215 
216  /* Signal the logger thread */
219 }
220 
221 VOID
222 NTAPI
223 INIT_FUNCTION
224 KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable,
225  ULONG BootPhase)
226 {
231  HANDLE ThreadHandle;
233  SIZE_T MemSizeMBs;
234 
235  if (!KdpDebugMode.File) return;
236 
237  if (BootPhase == 0)
238  {
240 
241  /* Write out the functions that we support for now */
242  DispatchTable->KdpInitRoutine = KdpInitDebugLog;
243  DispatchTable->KdpPrintRoutine = KdpPrintToLogFile;
244 
245  /* Register as a Provider */
246  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
247 
248  }
249  else if (BootPhase == 1)
250  {
251  /* Allocate a buffer for debug log */
254 
255  /* Initialize spinlock */
257 
258  /* Display separator + ReactOS version at start of the debug log */
259  /* Round size up. Assumed to better match actual physical RAM size */
260  MemSizeMBs = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
261  KdpPrintBanner(MemSizeMBs);
262  }
263  else if (BootPhase == 2)
264  {
265  HalDisplayString("\r\n File log debugging enabled\r\n\r\n");
266  }
267  else if (BootPhase == 3)
268  {
269  /* Setup the log name */
271  if (!NT_SUCCESS(Status)) return;
272 
274  &FileName,
275  0,
276  NULL,
277  NULL);
278 
279  /* Create the log file */
283  &Iosb,
284  NULL,
289  NULL,
290  0);
291 
293 
294  if (!NT_SUCCESS(Status)) return;
295 
297 
298  /* Create the logger thread */
299  Status = PsCreateSystemThread(&ThreadHandle,
301  NULL,
302  NULL,
303  NULL,
305  NULL);
306 
307  if (!NT_SUCCESS(Status)) return;
308 
309  Priority = 7;
310  NtSetInformationThread(ThreadHandle,
312  &Priority,
313  sizeof(Priority));
314  }
315 }
316 
317 /* SERIAL FUNCTIONS **********************************************************/
318 
319 VOID
320 NTAPI
322  ULONG Length)
323 {
324  KIRQL OldIrql;
325  PCHAR pch = (PCHAR) Message;
326 
327  /* Acquire the printing spinlock without waiting at raised IRQL */
328  while (TRUE)
329  {
330  /* Wait when the spinlock becomes available */
332 
333  /* Spinlock was free, raise IRQL */
335 
336  /* Try to get the spinlock */
338  break;
339 
340  /* Someone else got the spinlock, lower IRQL back */
342  }
343 
344  /* Output the message */
345  while (pch < Message + Length && *pch != '\0')
346  {
347  if (*pch == '\n')
348  {
350  }
352  pch++;
353  }
354 
355  /* Release spinlock */
357 
358  /* Lower IRQL */
360 }
361 
362 VOID
363 NTAPI
364 KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable,
365  ULONG BootPhase)
366 {
367  SIZE_T MemSizeMBs;
368  if (!KdpDebugMode.Serial) return;
369 
370  if (BootPhase == 0)
371  {
372  /* Write out the functions that we support for now */
373  DispatchTable->KdpInitRoutine = KdpSerialInit;
374  DispatchTable->KdpPrintRoutine = KdpSerialDebugPrint;
375 
376  /* Initialize the Port */
378  {
379  KdpDebugMode.Serial = FALSE;
380  return;
381  }
383 
384  /* Initialize spinlock */
386 
387  /* Register as a Provider */
388  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
389 
390  /* Display separator + ReactOS version at start of the debug log */
391  MemSizeMBs = KdpGetMemorySizeInMBs(KeLoaderBlock);
392  KdpPrintBanner(MemSizeMBs);
393  }
394  else if (BootPhase == 2)
395  {
396  HalDisplayString("\r\n Serial debugging enabled\r\n\r\n");
397  }
398 }
399 
400 /* SCREEN FUNCTIONS **********************************************************/
401 
402 /*
403  * Screen debug logger function KdpScreenPrint() writes text messages into
404  * KdpDmesgBuffer, using it as a circular buffer. KdpDmesgBuffer contents could
405  * be later (re)viewed using dmesg command of kdbg. KdpScreenPrint() protects
406  * KdpDmesgBuffer from simultaneous writes by use of KdpDmesgLogSpinLock.
407  */
408 VOID
409 NTAPI
411  ULONG Length)
412 {
413  ULONG beg, end, num;
414  KIRQL OldIrql;
415  PCHAR pch = (PCHAR) Message;
416 
417  while (pch < Message + Length && *pch)
418  {
419  if(*pch == '\b')
420  {
421  /* HalDisplayString does not support '\b'. Workaround it and use '\r' */
422  if(KdpScreenLineLength > 0)
423  {
424  /* Remove last character from buffer */
427 
428  /* Clear row and print line again */
429  HalDisplayString("\r");
431  }
432  }
433  else
434  {
437  }
438 
440  {
441  /* Print buffered characters */
444 
445  /* Clear line buffer */
446  KdpScreenLineBuffer[0] = '\0';
448  }
449 
450  ++pch;
451  }
452 
453  /* Print buffered characters */
455  {
458  }
459 
460  /* Dmesg: store Message in the buffer to show it later */
461  if (KdbpIsInDmesgMode)
462  return;
463 
464  if (KdpDmesgBuffer == NULL)
465  return;
466 
467  /* Acquire the printing spinlock without waiting at raised IRQL */
468  while (TRUE)
469  {
470  /* Wait when the spinlock becomes available */
472 
473  /* Spinlock was free, raise IRQL */
475 
476  /* Try to get the spinlock */
478  break;
479 
480  /* Someone else got the spinlock, lower IRQL back */
482  }
483 
484  /* Invariant: always_true(KdpDmesgFreeBytes == KdpDmesgBufferSize);
485  * set num to min(KdpDmesgFreeBytes, Length).
486  */
489  if (num != 0)
490  {
491  end = (beg + num) % KdpDmesgBufferSize;
492  if (end > beg)
493  {
495  }
496  else
497  {
500  }
502 
503  /* Counting the total bytes written */
505  }
506 
507  /* Release spinlock */
509 
510  /* Lower IRQL */
512 
513  /* Optional step(?): find out a way to notify about buffer exhaustion,
514  * and possibly fall into kbd to use dmesg command: user will read
515  * debug messages before they will be wiped over by next writes.
516  */
517 }
518 
519 VOID
520 NTAPI
521 KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable,
522  ULONG BootPhase)
523 {
524  SIZE_T MemSizeMBs;
525  if (!KdpDebugMode.Screen) return;
526 
527  if (BootPhase == 0)
528  {
529  /* Write out the functions that we support for now */
530  DispatchTable->KdpInitRoutine = KdpScreenInit;
531  DispatchTable->KdpPrintRoutine = KdpScreenPrint;
532 
533  /* Register as a Provider */
534  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
535  }
536  else if (BootPhase == 1)
537  {
538  /* Allocate a buffer for dmesg log buffer. +1 for terminating null,
539  * see kdbp_cli.c:KdbpCmdDmesg()/2
540  */
545 
546  /* Take control of the display */
549  InbvSolidColorFill(0, 0, 639, 479, 0);
550  InbvSetTextColor(15);
551  InbvSetScrollRegion(0, 0, 639, 479);
554 
555  /* Initialize spinlock */
557 
558  /* Display separator + ReactOS version at start of the debug log */
559  /* Round size up. Assumed to better match actual physical RAM size */
560  MemSizeMBs = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
561  KdpPrintBanner(MemSizeMBs);
562  }
563  else if (BootPhase == 2)
564  {
565  HalDisplayString("\r\n Screen debugging enabled\r\n\r\n");
566  }
567 }
568 
569 /* GENERAL FUNCTIONS *********************************************************/
570 
571 ULONG
572 NTAPI
574  _In_reads_bytes_(Length) PCHAR UnsafeString,
575  _In_ ULONG Length,
577 {
578  PLIST_ENTRY CurrentEntry;
579  PKD_DISPATCH_TABLE CurrentTable;
580  PCHAR String;
581  CHAR StringBuffer[512];
582 
583  if (!KdpDebugMode.Value) return 0;
584 
585  Length = min(Length, sizeof(StringBuffer));
586 
587  if (PreviousMode != KernelMode)
588  {
589  _SEH2_TRY
590  {
591  ProbeForRead(UnsafeString, Length, 1);
593  RtlCopyMemory(String, UnsafeString, Length);
594  }
596  {
597  return 0;
598  }
599  _SEH2_END;
600  }
601  else
602  {
603  String = UnsafeString;
604  }
605 
606  /* Call the registered handlers */
607  CurrentEntry = KdProviders.Flink;
608  while (CurrentEntry != &KdProviders)
609  {
610  /* Get the current table */
611  CurrentTable = CONTAINING_RECORD(CurrentEntry,
612  KD_DISPATCH_TABLE,
613  KdProvidersList);
614 
615  /* Call it */
616  CurrentTable->KdpPrintRoutine(String, Length);
617 
618  /* Next Table */
619  CurrentEntry = CurrentEntry->Flink;
620  }
621 
622  /* Call the Wrapper Routine */
623  if (WrapperTable.KdpPrintRoutine)
624  WrapperTable.KdpPrintRoutine(String, Length);
625 
626  /* Return the Length */
627  return Length;
628 }
629 
630 /* EOF */
signed char * PCHAR
Definition: retypes.h:7
BOOLEAN KdpLoggingEnabled
Definition: kdio.c:20
CHAR KdpScreenLineBuffer[KdpScreenLineLengthDefault+1]
Definition: kdio.c:37
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define IN
Definition: typedefs.h:38
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
HANDLE KdpLogFileHandle
Definition: kdio.c:26
PSTR ArcBootDeviceName
Definition: arc.h:503
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
volatile ULONG KdpDmesgCurrentPosition
Definition: kdio.c:42
volatile ULONG KdpFreeBytes
Definition: kdio.c:23
PCHAR KdpDmesgBuffer
Definition: kdio.c:41
char CHAR
Definition: xmlstorage.h:175
ULONG KdpScreenLineLength
Definition: kdio.c:38
LONG NTSTATUS
Definition: precomp.h:26
_In_ KPRIORITY Priority
Definition: kefuncs.h:516
KSPIN_LOCK KdpDmesgLogSpinLock
Definition: kdio.c:45
VOID NTAPI KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:364
VOID NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
Definition: inbv.c:720
static WCHAR String[]
Definition: stringtable.c:55
GLuint GLuint end
Definition: gl.h:1545
VOID NTAPI INIT_FUNCTION KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:224
#define InsertTailList(ListHead, Entry)
char * LPSTR
Definition: xmlstorage.h:182
#define FILE_APPEND_DATA
Definition: nt_native.h:634
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
LONG KPRIORITY
Definition: compat.h:454
#define pch(ap)
Definition: match.c:418
KEVENT KdpLoggerThreadEvent
Definition: kdio.c:25
#define FILE_SHARE_READ
Definition: compat.h:125
_SEH2_TRY
Definition: create.c:4250
LIST_ENTRY KdProviders
Definition: kdinit.c:29
VOID NTAPI KdpLoggerThread(PVOID Context)
Definition: kdio.c:116
KSPIN_LOCK KdpDebugLogSpinLock
Definition: kdio.c:24
BOOLEAN NTAPI KdPortInitializeEx(PCPPORT PortInformation, ULONG ComPortNumber)
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
static VOID INIT_FUNCTION KdpPrintBanner(IN SIZE_T MemSizeMBs)
Definition: kdio.c:103
VOID NTAPI KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:521
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:39
Definition: arc.h:130
ULONG KdpPort
Definition: kdio.c:34
#define DEFAULT_DEBUG_PORT
Definition: kdcom.c:18
CHAR * PCH
Definition: ntbasedef.h:398
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
#define FILE_WRITE_THROUGH
Definition: from_kernel.h:26
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
ANSI_STRING KdpLogFileName
Definition: kdio.c:27
volatile ULONG KdbDmesgTotalWritten
Definition: kdio.c:44
VOID NTAPI KdPortPutByteEx(PCPPORT PortInformation, UCHAR ByteToSend)
NTSTATUS NTAPI NtSetInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: query.c:2014
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
VOID NTAPI InbvSetTextColor(IN ULONG Color)
Definition: inbv.c:696
#define PCHAR
Definition: match.c:90
BOOLEAN FASTCALL KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:442
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
volatile ULONG KdpCurrentPosition
Definition: kdio.c:22
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define DEFAULT_DEBUG_BAUD_RATE
Definition: kdcom.c:21
PUCHAR KdComPortInUse
Definition: usage.c:17
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
return Iosb
Definition: create.c:4426
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define InterlockedExchangeAddUL(Addend, Value)
Definition: ex.h:1519
VOID NTAPI KdpPrintToLogFile(PCH String, ULONG StringLength)
Definition: kdio.c:163
GLuint GLuint num
Definition: glext.h:9618
#define KdpBufferSize
Definition: kdio.c:19
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define KdpScreenLineLengthDefault
Definition: kdio.c:36
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
PCHAR KdpDebugBuffer
Definition: kdio.c:21
CHAR Message[80]
Definition: alive.c:5
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:532
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define VOID
Definition: acefi.h:82
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
VOID NTAPI KdpScreenPrint(LPSTR Message, ULONG Length)
Definition: kdio.c:410
#define PAGE_SIZE
Definition: env_spec_w32.h:49
volatile ULONG KdpDmesgFreeBytes
Definition: kdio.c:43
Definition: typedefs.h:117
#define SYNCHRONIZE
Definition: nt_native.h:61
const ULONG KdpDmesgBufferSize
Definition: kdio.c:40
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
VOID NTAPI KdpSerialDebugPrint(LPSTR Message, ULONG Length)
Definition: kdio.c:321
PUCHAR Address
Definition: cportlib.h:29
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
Status
Definition: gdiplustypes.h:24
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
BOOLEAN NTAPI InbvEnableDisplayString(IN BOOLEAN Enable)
Definition: inbv.c:610
#define _In_
Definition: no_sal2.h:204
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
struct _FileName FileName
Definition: fatprocs.h:884
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
_SEH2_END
Definition: create.c:4424
BOOLEAN NTAPI InbvResetDisplay(VOID)
Definition: inbv.c:668
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
KSPIN_LOCK KdpSerialSpinLock
Definition: kdio.c:29
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
#define min(a, b)
Definition: monoChain.cc:55
CPPORT SerialPortInfo
Definition: kdio.c:31
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:626
#define DPRINT1
Definition: precomp.h:8
ULONG SerialPortNumber
Definition: kdio.c:30
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
ULONG KdpScreenLineBufferPos
Definition: kdio.c:38
volatile BOOLEAN KdbpIsInDmesgMode
Definition: kdio.c:46
KD_DISPATCH_TABLE WrapperTable
Definition: kdinit.c:28
unsigned int ULONG
Definition: retypes.h:1
#define FILE_SUPERSEDE
Definition: from_kernel.h:53
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ALIGN_UP_BY(size, align)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
static SIZE_T INIT_FUNCTION KdpGetMemorySizeInMBs(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: kdio.c:62
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
ULONG NTAPI KdpPrintString(_In_reads_bytes_(Length) PCHAR UnsafeString, _In_ ULONG Length, _In_ KPROCESSOR_MODE PreviousMode)
Definition: kdio.c:573
VOID NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
Definition: inbv.c:685
BOOLEAN FASTCALL KeTryToAcquireSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK SpinLock)
Definition: spinlock.c:303
WCHAR StringBuffer[156]
Definition: ldrinit.c:41
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966