Skip to content

Commit e28ec79

Browse files
committed
[NTOS:KD] Remove useless variables/members
Those where only set and never read.
1 parent 6ad74e4 commit e28ec79

File tree

4 files changed

+2
-96
lines changed

4 files changed

+2
-96
lines changed

ntoskrnl/include/internal/kd.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,6 @@ VOID
105105
ULONG Length
106106
);
107107

108-
typedef
109-
VOID
110-
(NTAPI*PKDP_PROMPT_ROUTINE)(PCH String);
111-
112-
typedef
113-
KD_CONTINUE_TYPE
114-
(NTAPI*PKDP_EXCEPTION_ROUTINE)(
115-
PEXCEPTION_RECORD ExceptionRecord,
116-
PCONTEXT Context,
117-
PKTRAP_FRAME TrapFrame
118-
);
119-
120108
/* INIT ROUTINES *************************************************************/
121109

122110
BOOLEAN
@@ -239,35 +227,21 @@ typedef struct _KD_DISPATCH_TABLE
239227
LIST_ENTRY KdProvidersList;
240228
PKDP_INIT_ROUTINE KdpInitRoutine;
241229
PKDP_PRINT_ROUTINE KdpPrintRoutine;
242-
PKDP_PROMPT_ROUTINE KdpPromptRoutine;
243-
PKDP_EXCEPTION_ROUTINE KdpExceptionRoutine;
244230
} KD_DISPATCH_TABLE, *PKD_DISPATCH_TABLE;
245231

246232
/* The current Debugging Mode */
247233
extern KDP_DEBUG_MODE KdpDebugMode;
248234

249-
/* The current Port IRQ */
250-
extern ULONG KdpPortIrq;
251-
252-
/* The current Port */
253-
extern ULONG KdpPort;
254-
255235
/* Port Information for the Serial Native Mode */
256236
extern ULONG SerialPortNumber;
257237
extern CPPORT SerialPortInfo;
258238

259239
/* Init Functions for Native Providers */
260240
extern PKDP_INIT_ROUTINE InitRoutines[KdMax];
261241

262-
/* Wrapper Init Function */
263-
extern PKDP_INIT_ROUTINE WrapperInitRoutine;
264-
265242
/* Dispatch Tables for Native Providers */
266243
extern KD_DISPATCH_TABLE DispatchTable[KdMax];
267244

268-
/* Dispatch Table for the Wrapper */
269-
extern KD_DISPATCH_TABLE WrapperTable;
270-
271245
/* The KD Native Provider List */
272246
extern LIST_ENTRY KdProviders;
273247

ntoskrnl/kd/kdio.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ static KSPIN_LOCK KdpSerialSpinLock;
3131
ULONG SerialPortNumber = DEFAULT_DEBUG_PORT;
3232
CPPORT SerialPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0};
3333

34-
/* Current Port in use. FIXME: Do we support more than one? */
35-
ULONG KdpPort;
36-
3734
#define KdpScreenLineLengthDefault 80
3835
static CHAR KdpScreenLineBuffer[KdpScreenLineLengthDefault + 1] = "";
3936
static ULONG KdpScreenLineBufferPos = 0, KdpScreenLineLength = 0;
@@ -543,11 +540,6 @@ KdSendPacket(
543540
/* Next Table */
544541
CurrentEntry = CurrentEntry->Flink;
545542
}
546-
547-
/* Call the Wrapper Routine */
548-
if (WrapperTable.KdpPrintRoutine)
549-
WrapperTable.KdpPrintRoutine(Output->Buffer, Output->Length);
550-
551543
return;
552544
}
553545
else if (PacketType == PACKET_TYPE_KD_STATE_CHANGE64)

ntoskrnl/kd/kdmain.c

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
VOID NTAPI PspDumpThreads(BOOLEAN SystemThreads);
1717

18-
extern CPPORT PortInfo;
1918
extern ANSI_STRING KdpLogFileName;
2019

2120
/* PRIVATE FUNCTIONS *********************************************************/
@@ -49,14 +48,6 @@ KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
4948
TrapFrame,
5049
!SecondChanceException);
5150
#else /* not KDBG */
52-
if (WrapperInitRoutine)
53-
{
54-
/* Call GDB */
55-
Return = WrapperTable.KdpExceptionRoutine(ExceptionRecord,
56-
ContextRecord,
57-
TrapFrame);
58-
}
59-
6051
/* We'll manually dump the stack for the user... */
6152
KeRosDumpStackFrames(NULL, 0);
6253
#endif /* not KDBG */
@@ -99,7 +90,6 @@ KdpGetDebugMode(PCHAR Currentp2)
9990

10091
/* Set the port to use */
10192
SerialPortNumber = Value;
102-
KdpPort = Value;
10393
}
10494
}
10595
else
@@ -110,7 +100,6 @@ KdpGetDebugMode(PCHAR Currentp2)
110100
KdpDebugMode.Serial = TRUE;
111101
SerialPortInfo.Address = UlongToPtr(Value);
112102
SerialPortNumber = 0;
113-
KdpPort = 0;
114103
}
115104
}
116105
}
@@ -138,9 +127,8 @@ NTAPI
138127
KdDebuggerInitialize0(
139128
IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
140129
{
141-
ULONG Value;
142130
ULONG i;
143-
PCHAR CommandLine, Port = NULL, BaudRate = NULL, Irq = NULL;
131+
PCHAR CommandLine, Port = NULL;
144132

145133
if (LoaderBlock)
146134
{
@@ -156,10 +144,8 @@ KdDebuggerInitialize0(
156144
KdbpGetCommandLineSettings(CommandLine);
157145
#endif
158146

159-
/* Get the port and baud rate */
147+
/* Get the port */
160148
Port = strstr(CommandLine, "DEBUGPORT");
161-
BaudRate = strstr(CommandLine, "BAUDRATE");
162-
Irq = strstr(CommandLine, "IRQ");
163149
}
164150
}
165151

@@ -182,42 +168,6 @@ KdDebuggerInitialize0(
182168
if (KdpDebugMode.Value == 0)
183169
KdpDebugMode.Serial = TRUE;
184170

185-
/* Check if we got a baud rate */
186-
if (BaudRate)
187-
{
188-
/* Move past the actual string, to reach the rate */
189-
BaudRate += sizeof("BAUDRATE") - 1;
190-
191-
/* Now get past any spaces */
192-
while (*BaudRate == ' ') BaudRate++;
193-
194-
/* And make sure we have a rate */
195-
if (*BaudRate)
196-
{
197-
/* Read and set it */
198-
Value = atol(BaudRate + 1);
199-
if (Value) PortInfo.BaudRate = SerialPortInfo.BaudRate = Value;
200-
}
201-
}
202-
203-
/* Check Serial Port Settings [IRQ] */
204-
if (Irq)
205-
{
206-
/* Move past the actual string, to reach the rate */
207-
Irq += sizeof("IRQ") - 1;
208-
209-
/* Now get past any spaces */
210-
while (*Irq == ' ') Irq++;
211-
212-
/* And make sure we have an IRQ */
213-
if (*Irq)
214-
{
215-
/* Read and set it */
216-
Value = atol(Irq + 1);
217-
if (Value) KdpPortIrq = Value;
218-
}
219-
}
220-
221171
/* Call Providers at Phase 0 */
222172
for (i = 0; i < KdMax; i++)
223173
{
@@ -251,10 +201,6 @@ KdDebuggerInitialize1(
251201
CurrentEntry = CurrentEntry->Flink;
252202
}
253203

254-
/* Call the Wrapper Init Routine */
255-
if (WrapperInitRoutine)
256-
WrapperTable.KdpInitRoutine(&WrapperTable, 1);
257-
258204
NtGlobalFlag |= FLG_STOP_ON_EXCEPTION;
259205

260206
return STATUS_SUCCESS;

ntoskrnl/kd64/kddata.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,7 @@ ULONG KdPrintBufferSize = sizeof(KdPrintDefaultCircularBuffer);
138138
ULONG KdPrintBufferChanges = 0;
139139

140140
#ifndef _WINKD_
141-
/* Make bochs debug output in the very early boot phase available */
142-
ULONG PortNumber = DEFAULT_DEBUG_PORT;
143-
CPPORT PortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0};
144-
ULONG KdpPortIrq;
145141
KDP_DEBUG_MODE KdpDebugMode;
146-
PKDP_INIT_ROUTINE WrapperInitRoutine;
147-
KD_DISPATCH_TABLE WrapperTable;
148142
LIST_ENTRY KdProviders = {&KdProviders, &KdProviders};
149143
KD_DISPATCH_TABLE DispatchTable[KdMax];
150144

0 commit comments

Comments
 (0)