ComPortBase = ULongToPtr(DeviceExtension->BaseAddress);
/* Test if we are trying to start the serial port used for debugging */
- DPRINT1("KdComPort: %p\n", KdComPortInUse);
- if (KdComPortInUse == ULongToPtr(DeviceExtension->BaseAddress))
+ if (*KdComPortInUse == ULongToPtr(DeviceExtension->BaseAddress))
{
DPRINT("Failing IRP_MN_START_DEVICE as this serial port is used for debugging\n");
return STATUS_INSUFFICIENT_RESOURCES;
IoSetPartitionInformation@16=HalpSetPartitionInformation@16
IoWritePartitionTable@20=HalpWritePartitionTable@20
KeAcquireSpinLock@8
-KdComPortInUse=_KdComPortInUse
+KdComPortInUse=_KdComPortInUse DATA
KeFlushWriteBuffer@0
KeGetCurrentIrql@0
KeLowerIrql@4
#define NDEBUG
#include <debug.h>
-ULONG KdComPortInUse = 0;
+#ifdef __GNUC__
+static PUCHAR realKdComPortInUse = 0;
+PUCHAR *_KdComPortInUse = &realKdComPortInUse;
+#else
+PUCHAR _KdComPortInUse = 0;
+#endif
/* FUNCTIONS *****************************************************************/
/* Temporary hack */
#define KPCR_BASE 0xFF000000
-/* WDK Hack */
-#define KdComPortInUse _KdComPortInUse
-
#define HAL_APC_REQUEST 0
#define HAL_DPC_REQUEST 1
// HAL Exports
//
#ifndef _NTHAL_
-extern PUCHAR *KdComPortInUse;
+extern DECL_IMPORT PUCHAR *KdComPortInUse;
#endif
#endif
/* Current Port in use. FIXME: Do we support more then one? */
ULONG KdpPort;
-/* If serial debugging is enabled, is pointing to the UART base address. */
-PUCHAR *KdComPortInUse;
/* DEBUG LOG FUNCTIONS *******************************************************/
if (BootPhase == 0)
{
- KdComPortInUse = NULL;
+ *KdComPortInUse = NULL;
/* Write out the functions that we support for now */
DispatchTable->KdpInitRoutine = KdpInitDebugLog;
KdpDebugMode.Serial = FALSE;
return;
}
- KdComPortInUse = (PUCHAR*)&SerialPortInfo.BaseAddress;
+ *KdComPortInUse = (PUCHAR)(ULONG_PTR)SerialPortInfo.BaseAddress;
/* Register as a Provider */
InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);