mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:25:58 +00:00
[NTOS:KD] Split internal/kd.h into a part shared in the whole kernel and a private part only used within ntoskrnl/kd.
This commit is contained in:
parent
bfd07a02f1
commit
eb02a85214
4 changed files with 123 additions and 120 deletions
|
@ -5,7 +5,6 @@
|
||||||
//
|
//
|
||||||
// Kernel Debugger Port Definition
|
// Kernel Debugger Port Definition
|
||||||
//
|
//
|
||||||
struct _KD_DISPATCH_TABLE;
|
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -29,7 +28,7 @@ KdPortPutByteEx(
|
||||||
|
|
||||||
#ifdef _NTOSKRNL_
|
#ifdef _NTOSKRNL_
|
||||||
|
|
||||||
/* KD ROUTINES ***************************************************************/
|
/* KD GLOBALS ****************************************************************/
|
||||||
|
|
||||||
typedef enum _KD_CONTINUE_TYPE
|
typedef enum _KD_CONTINUE_TYPE
|
||||||
{
|
{
|
||||||
|
@ -38,94 +37,6 @@ typedef enum _KD_CONTINUE_TYPE
|
||||||
kdHandleException
|
kdHandleException
|
||||||
} KD_CONTINUE_TYPE;
|
} KD_CONTINUE_TYPE;
|
||||||
|
|
||||||
typedef
|
|
||||||
NTSTATUS
|
|
||||||
(NTAPI *PKDP_INIT_ROUTINE)(
|
|
||||||
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
|
||||||
_In_ ULONG BootPhase);
|
|
||||||
|
|
||||||
typedef
|
|
||||||
VOID
|
|
||||||
(NTAPI*PKDP_PRINT_ROUTINE)(
|
|
||||||
PCHAR String,
|
|
||||||
ULONG Length
|
|
||||||
);
|
|
||||||
|
|
||||||
/* INIT ROUTINES *************************************************************/
|
|
||||||
|
|
||||||
KIRQL
|
|
||||||
NTAPI
|
|
||||||
KdbpAcquireLock(
|
|
||||||
_In_ PKSPIN_LOCK SpinLock);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
KdbpReleaseLock(
|
|
||||||
_In_ PKSPIN_LOCK SpinLock,
|
|
||||||
_In_ KIRQL OldIrql);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
KdpScreenAcquire(VOID);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
KdpScreenRelease(VOID);
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
KdpScreenInit(
|
|
||||||
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
|
||||||
_In_ ULONG BootPhase);
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
KdpSerialInit(
|
|
||||||
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
|
||||||
_In_ ULONG BootPhase);
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
KdpDebugLogInit(
|
|
||||||
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
|
||||||
_In_ ULONG BootPhase);
|
|
||||||
|
|
||||||
#ifdef KDBG
|
|
||||||
#define KdpKdbgInit KdbInitialize
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* KD GLOBALS ***************************************************************/
|
|
||||||
|
|
||||||
/* Serial debug connection */
|
|
||||||
#define DEFAULT_DEBUG_PORT 2 /* COM2 */
|
|
||||||
#define DEFAULT_DEBUG_COM1_IRQ 4 /* COM1 IRQ */
|
|
||||||
#define DEFAULT_DEBUG_COM2_IRQ 3 /* COM2 IRQ */
|
|
||||||
#define DEFAULT_DEBUG_BAUD_RATE 115200 /* 115200 Baud */
|
|
||||||
|
|
||||||
/* KD Native Modes */
|
|
||||||
#define KdScreen 0
|
|
||||||
#define KdSerial 1
|
|
||||||
#define KdFile 2
|
|
||||||
#define KdKdbg 3
|
|
||||||
#define KdMax 4
|
|
||||||
|
|
||||||
/* KD Private Debug Modes */
|
|
||||||
typedef struct _KDP_DEBUG_MODE
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
/* Native Modes */
|
|
||||||
UCHAR Screen :1;
|
|
||||||
UCHAR Serial :1;
|
|
||||||
UCHAR File :1;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Generic Value */
|
|
||||||
ULONG Value;
|
|
||||||
};
|
|
||||||
} KDP_DEBUG_MODE;
|
|
||||||
|
|
||||||
/* KD Internal Debug Services */
|
/* KD Internal Debug Services */
|
||||||
typedef enum _KDP_DEBUG_SERVICE
|
typedef enum _KDP_DEBUG_SERVICE
|
||||||
{
|
{
|
||||||
|
@ -143,31 +54,6 @@ typedef enum _KDP_DEBUG_SERVICE
|
||||||
ThatsWhatSheSaid = 69 /* FIGURE IT OUT */
|
ThatsWhatSheSaid = 69 /* FIGURE IT OUT */
|
||||||
} KDP_DEBUG_SERVICE;
|
} KDP_DEBUG_SERVICE;
|
||||||
|
|
||||||
/* Dispatch Table for Wrapper Functions */
|
|
||||||
typedef struct _KD_DISPATCH_TABLE
|
|
||||||
{
|
|
||||||
LIST_ENTRY KdProvidersList;
|
|
||||||
PKDP_INIT_ROUTINE KdpInitRoutine;
|
|
||||||
PKDP_PRINT_ROUTINE KdpPrintRoutine;
|
|
||||||
NTSTATUS InitStatus;
|
|
||||||
} KD_DISPATCH_TABLE, *PKD_DISPATCH_TABLE;
|
|
||||||
|
|
||||||
/* The current Debugging Mode */
|
|
||||||
extern KDP_DEBUG_MODE KdpDebugMode;
|
|
||||||
|
|
||||||
/* Port Information for the Serial Native Mode */
|
|
||||||
extern ULONG SerialPortNumber;
|
|
||||||
extern CPPORT SerialPortInfo;
|
|
||||||
|
|
||||||
/* Init Functions for Native Providers */
|
|
||||||
extern PKDP_INIT_ROUTINE InitRoutines[KdMax];
|
|
||||||
|
|
||||||
/* Dispatch Tables for Native Providers */
|
|
||||||
extern KD_DISPATCH_TABLE DispatchTable[KdMax];
|
|
||||||
|
|
||||||
/* The KD Native Provider List */
|
|
||||||
extern LIST_ENTRY KdProviders;
|
|
||||||
|
|
||||||
#endif // _NTOSKRNL_
|
#endif // _NTOSKRNL_
|
||||||
|
|
||||||
#if DBG && defined(_M_IX86) && !defined(_WINKD_) // See ke/i386/traphdlr.c
|
#if DBG && defined(_M_IX86) && !defined(_WINKD_) // See ke/i386/traphdlr.c
|
||||||
|
|
121
ntoskrnl/kd/kd.h
Normal file
121
ntoskrnl/kd/kd.h
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* KD ROUTINES ***************************************************************/
|
||||||
|
|
||||||
|
struct _KD_DISPATCH_TABLE;
|
||||||
|
|
||||||
|
typedef
|
||||||
|
NTSTATUS
|
||||||
|
(NTAPI *PKDP_INIT_ROUTINE)(
|
||||||
|
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
||||||
|
_In_ ULONG BootPhase);
|
||||||
|
|
||||||
|
typedef
|
||||||
|
VOID
|
||||||
|
(NTAPI *PKDP_PRINT_ROUTINE)(
|
||||||
|
PCHAR String,
|
||||||
|
ULONG Length
|
||||||
|
);
|
||||||
|
|
||||||
|
/* INIT ROUTINES *************************************************************/
|
||||||
|
|
||||||
|
KIRQL
|
||||||
|
NTAPI
|
||||||
|
KdbpAcquireLock(
|
||||||
|
_In_ PKSPIN_LOCK SpinLock);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KdbpReleaseLock(
|
||||||
|
_In_ PKSPIN_LOCK SpinLock,
|
||||||
|
_In_ KIRQL OldIrql);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
KdpScreenAcquire(VOID);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
KdpScreenRelease(VOID);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
KdpScreenInit(
|
||||||
|
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
||||||
|
_In_ ULONG BootPhase);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
KdpSerialInit(
|
||||||
|
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
||||||
|
_In_ ULONG BootPhase);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
KdpDebugLogInit(
|
||||||
|
_In_ struct _KD_DISPATCH_TABLE *DispatchTable,
|
||||||
|
_In_ ULONG BootPhase);
|
||||||
|
|
||||||
|
#ifdef KDBG
|
||||||
|
#define KdpKdbgInit KdbInitialize
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* KD GLOBALS ****************************************************************/
|
||||||
|
|
||||||
|
/* Serial debug connection */
|
||||||
|
#define DEFAULT_DEBUG_PORT 2 /* COM2 */
|
||||||
|
#define DEFAULT_DEBUG_COM1_IRQ 4 /* COM1 IRQ */
|
||||||
|
#define DEFAULT_DEBUG_COM2_IRQ 3 /* COM2 IRQ */
|
||||||
|
#define DEFAULT_DEBUG_BAUD_RATE 115200 /* 115200 Baud */
|
||||||
|
|
||||||
|
/* KD Native Modes */
|
||||||
|
#define KdScreen 0
|
||||||
|
#define KdSerial 1
|
||||||
|
#define KdFile 2
|
||||||
|
#define KdKdbg 3
|
||||||
|
#define KdMax 4
|
||||||
|
|
||||||
|
/* KD Private Debug Modes */
|
||||||
|
typedef struct _KDP_DEBUG_MODE
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
/* Native Modes */
|
||||||
|
UCHAR Screen :1;
|
||||||
|
UCHAR Serial :1;
|
||||||
|
UCHAR File :1;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Generic Value */
|
||||||
|
ULONG Value;
|
||||||
|
};
|
||||||
|
} KDP_DEBUG_MODE;
|
||||||
|
|
||||||
|
/* Dispatch Table for Wrapper Functions */
|
||||||
|
typedef struct _KD_DISPATCH_TABLE
|
||||||
|
{
|
||||||
|
LIST_ENTRY KdProvidersList;
|
||||||
|
PKDP_INIT_ROUTINE KdpInitRoutine;
|
||||||
|
PKDP_PRINT_ROUTINE KdpPrintRoutine;
|
||||||
|
NTSTATUS InitStatus;
|
||||||
|
} KD_DISPATCH_TABLE, *PKD_DISPATCH_TABLE;
|
||||||
|
|
||||||
|
/* The current Debugging Mode */
|
||||||
|
extern KDP_DEBUG_MODE KdpDebugMode;
|
||||||
|
|
||||||
|
/* Port Information for the Serial Native Mode */
|
||||||
|
extern ULONG SerialPortNumber;
|
||||||
|
extern CPPORT SerialPortInfo;
|
||||||
|
|
||||||
|
/* Logging file path */
|
||||||
|
extern ANSI_STRING KdpLogFileName;
|
||||||
|
|
||||||
|
/* Init Functions for Native Providers */
|
||||||
|
extern PKDP_INIT_ROUTINE InitRoutines[KdMax];
|
||||||
|
|
||||||
|
/* Dispatch Tables for Native Providers */
|
||||||
|
extern KD_DISPATCH_TABLE DispatchTable[KdMax];
|
||||||
|
|
||||||
|
/* The KD Native Provider List */
|
||||||
|
extern LIST_ENTRY KdProviders;
|
|
@ -11,10 +11,6 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/* VARIABLES ***************************************************************/
|
|
||||||
|
|
||||||
extern ANSI_STRING KdpLogFileName;
|
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS *********************************************************/
|
/* PUBLIC FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
static PCHAR
|
static PCHAR
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "internal/kd.h"
|
#include "../kd/kd.h"
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue