mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[KDCOM]
Revert r52482, it didn't really work. Instead grab the StallScaleFactor from the PCR and use this as a base for the repeat count. svn path=/trunk/; revision=52487
This commit is contained in:
@@ -9,9 +9,6 @@
|
||||
#include "kddll.h"
|
||||
#include "kdcom.h"
|
||||
|
||||
/* Define wait timeout value. */
|
||||
#define REPEAT_COUNT 100
|
||||
|
||||
/* serial debug connection */
|
||||
#define DEFAULT_DEBUG_PORT 2 /* COM2 */
|
||||
#define DEFAULT_DEBUG_COM1_IRQ 4 /* COM1 IRQ */
|
||||
@@ -126,6 +123,10 @@ KdDebuggerInitialize0(
|
||||
/* Check if e have a LoaderBlock */
|
||||
if (LoaderBlock)
|
||||
{
|
||||
/* HACK */
|
||||
KdpDbgPrint = LoaderBlock->u.I386.CommonDataArea;
|
||||
KDDEBUG("KdDebuggerInitialize0\n");
|
||||
|
||||
/* Get the Command Line */
|
||||
CommandLine = LoaderBlock->LoadOptions;
|
||||
|
||||
@@ -248,7 +249,7 @@ KDP_STATUS
|
||||
NTAPI
|
||||
KdpReceiveByte(OUT PBYTE OutByte)
|
||||
{
|
||||
ULONG Repeats = REPEAT_COUNT;
|
||||
ULONG Repeats = KdpStallScaleFactor * 100;
|
||||
|
||||
while (Repeats--)
|
||||
{
|
||||
@@ -258,20 +259,6 @@ KdpReceiveByte(OUT PBYTE OutByte)
|
||||
/* We successfully got a byte */
|
||||
return KDP_PACKET_RECEIVED;
|
||||
}
|
||||
|
||||
/* Check if phase 1 is complete */
|
||||
if (KdpPhase1Complete)
|
||||
{
|
||||
/* Use hal to wait 1ms */
|
||||
KeStallExecutionProcessor(1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
volatile unsigned long i;
|
||||
|
||||
/* Do some busy waiting */
|
||||
for (i = 0; i < 1000; i++);
|
||||
}
|
||||
}
|
||||
|
||||
/* Timed out */
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* PROGRAMMER: Timo Kreuzer ([email protected])
|
||||
*/
|
||||
|
||||
//#define KDDEBUG /* uncomment to enable debugging this dll */
|
||||
#include "kddll.h"
|
||||
|
||||
/* GLOBALS ********************************************************************/
|
||||
@@ -15,6 +14,7 @@ PFNDBGPRNT KdpDbgPrint = NULL;
|
||||
ULONG CurrentPacketId = INITIAL_PACKET_ID | SYNC_PACKET_ID;
|
||||
ULONG RemotePacketId = 0;
|
||||
BOOLEAN KdpPhase1Complete = FALSE;
|
||||
ULONG KdpStallScaleFactor = 1000;
|
||||
|
||||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
@@ -89,6 +89,7 @@ NTAPI
|
||||
KdDebuggerInitialize1(
|
||||
IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
|
||||
{
|
||||
KdpStallScaleFactor = KeGetPcr()->StallScaleFactor * 100;
|
||||
KdpPhase1Complete = TRUE;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
//#define KDDEBUG /* uncomment to enable debugging this dll */
|
||||
|
||||
#define NOEXTAPI
|
||||
#include <ntifs.h>
|
||||
#define NDEBUG
|
||||
@@ -26,6 +28,7 @@ typedef UCHAR BYTE, *PBYTE;
|
||||
typedef ULONG (*PFNDBGPRNT)(const char *Format, ...);
|
||||
extern PFNDBGPRNT KdpDbgPrint;
|
||||
extern BOOLEAN KdpPhase1Complete;
|
||||
extern ULONG KdpStallScaleFactor;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user