Author: ion
Date: Thu Nov 30 01:12:50 2006
New Revision: 24977
URL:
http://svn.reactos.org/svn/reactos?rev=24977&view=rev
Log:
- Add profil.c and stub HalStartProfileInterrupt, HalStopProfileInterrupt and
HalSetProfileInterval, and export these functions.
- KdComPortInUse is exported by HAL, not kdcom, so make the change.
- Register the KD support routines that kdcom on NT uses and implement most of them
(except support for PCI Debug Cards).
- I can now get Windows to recognize the HAL but it freezes during loading (Due to broken
IRQL implementation) and WinDBG won't connect to it.
Added:
trunk/reactos/hal/halx86/generic/profil.c
Modified:
trunk/reactos/drivers/base/kdcom/kdcom.def
trunk/reactos/hal/hal/hal.def
trunk/reactos/hal/halx86/generic/bus.c
trunk/reactos/hal/halx86/generic/generic.rbuild
trunk/reactos/hal/halx86/generic/misc.c
trunk/reactos/hal/halx86/generic/pci.c
trunk/reactos/hal/halx86/generic/processor.c
trunk/reactos/hal/halx86/generic/sysinfo.c
trunk/reactos/hal/halx86/include/halp.h
Modified: trunk/reactos/drivers/base/kdcom/kdcom.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdcom.d…
==============================================================================
--- trunk/reactos/drivers/base/kdcom/kdcom.def (original)
+++ trunk/reactos/drivers/base/kdcom/kdcom.def Thu Nov 30 01:12:50 2006
@@ -1,7 +1,6 @@
LIBRARY kdcom.dll
EXPORTS
-KdComPortInUse=_KdComPortInUse
KdPortGetByte@4
KdPortGetByteEx@8
KdPortInitialize@12
Modified: trunk/reactos/hal/hal/hal.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/hal/hal.def?rev=24977&…
==============================================================================
--- trunk/reactos/hal/hal/hal.def (original)
+++ trunk/reactos/hal/hal/hal.def Thu Nov 30 01:12:50 2006
@@ -13,6 +13,7 @@
@KeAcquireInStackQueuedSpinLockRaiseToSynch@8
@KeAcquireSpinLockRaiseToSynch@4
@KeAcquireQueuedSpinLock@4
+@KeAcquireQueuedSpinLockRaiseToSynch@4
@KeReleaseInStackQueuedSpinLock@4
@KeReleaseQueuedSpinLock@8
@KeTryToAcquireQueuedSpinLock@8
@@ -57,12 +58,12 @@
HalSetBusDataByOffset@24
HalSetDisplayParameters@8
HalSetEnvironmentVariable@8
-;HalSetProfileInterval@4
+HalSetProfileInterval@4
HalSetRealTimeClock@4
HalSetTimeIncrement@4
HalStartNextProcessor@8
-;HalStartProfileInterrupt@4
-;HalStopProfileInterrupt@4
+HalStartProfileInterrupt@4
+HalStopProfileInterrupt@4
HalTranslateBusAddress@24
IoAssignDriveLetters@16=HalpAssignDriveLetters@16
IoFlushAdapterBuffers@24
@@ -73,6 +74,7 @@
IoSetPartitionInformation@16=HalpSetPartitionInformation@16
IoWritePartitionTable@20=HalpWritePartitionTable@20
KeAcquireSpinLock@8
+KdComPortInUse=_KdComPortInUse
KeFlushWriteBuffer@0
KeGetCurrentIrql@0
KeLowerIrql@4
Modified: trunk/reactos/hal/halx86/generic/bus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus.c?r…
==============================================================================
--- trunk/reactos/hal/halx86/generic/bus.c (original)
+++ trunk/reactos/hal/halx86/generic/bus.c Thu Nov 30 01:12:50 2006
@@ -17,6 +17,22 @@
ULONG HalpBusType;
/* PRIVATE FUNCTIONS *********************************************************/
+
+VOID
+NTAPI
+HalpRegisterKdSupportFunctions(VOID)
+{
+ /* Register PCI Device Functions */
+ KdSetupPciDeviceForDebugging = HalpSetupPciDeviceForDebugging;
+ KdReleasePciDeviceforDebugging = HalpReleasePciDeviceForDebugging;
+
+ /* Register memory functions */
+ KdMapPhysicalMemory64 = HalpMapPhysicalMemory64;
+ KdUnmapVirtualAddress = HalpUnmapVirtualAddress;
+
+ /* Register ACPI stub */
+ KdCheckPowerButton = HalpCheckPowerButton;
+}
NTSTATUS
NTAPI
Modified: trunk/reactos/hal/halx86/generic/generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/generic…
==============================================================================
--- trunk/reactos/hal/halx86/generic/generic.rbuild (original)
+++ trunk/reactos/hal/halx86/generic/generic.rbuild Thu Nov 30 01:12:50 2006
@@ -12,6 +12,7 @@
<file>misc.c</file>
<file>pci.c</file>
<file>portio.c</file>
+ <file>profil.c</file>
<file>reboot.c</file>
<file>sysinfo.c</file>
<file>timer.c</file>
Modified: trunk/reactos/hal/halx86/generic/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/misc.c?…
==============================================================================
--- trunk/reactos/hal/halx86/generic/misc.c (original)
+++ trunk/reactos/hal/halx86/generic/misc.c Thu Nov 30 01:12:50 2006
@@ -7,13 +7,43 @@
* Eric Kohl (ekohl(a)abo.rhein-zeitung.de)
*/
-/* INCLUDES *****************************************************************/
+/* INCLUDES ******************************************************************/
#include <hal.h>
#define NDEBUG
#include <debug.h>
-/* FUNCTIONS ****************************************************************/
+/* PRIVATE FUNCTIONS *********************************************************/
+
+VOID
+NTAPI
+HalpCheckPowerButton(VOID)
+{
+ /* Nothing to do on non-ACPI */
+ return;
+}
+
+PVOID
+NTAPI
+HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN ULONG NumberPage)
+{
+ /* Use kernel memory manager I/O map facilities */
+ return MmMapIoSpace(PhysicalAddress,
+ NumberPage << PAGE_SHIFT,
+ MmNonCached);
+}
+
+VOID
+NTAPI
+HalpUnmapVirtualAddress(IN PVOID VirtualAddress,
+ IN ULONG NumberPages)
+{
+ /* Use kernel memory manager I/O map facilities */
+ return MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT);
+}
+
+/* FUNCTIONS *****************************************************************/
/*
* @implemented
Modified: trunk/reactos/hal/halx86/generic/pci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/pci.c?r…
==============================================================================
--- trunk/reactos/hal/halx86/generic/pci.c (original)
+++ trunk/reactos/hal/halx86/generic/pci.c Thu Nov 30 01:12:50 2006
@@ -470,6 +470,23 @@
NTSTATUS
NTAPI
+HalpSetupPciDeviceForDebugging(IN PVOID LoaderBlock,
+ IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
+{
+ DPRINT1("Unimplemented!\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+NTAPI
+HalpReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
+{
+ DPRINT1("Unimplemented!\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+NTAPI
HalpAssignPCISlotResources(IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler,
IN PUNICODE_STRING RegistryPath,
Modified: trunk/reactos/hal/halx86/generic/processor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/process…
==============================================================================
--- trunk/reactos/hal/halx86/generic/processor.c (original)
+++ trunk/reactos/hal/halx86/generic/processor.c Thu Nov 30 01:12:50 2006
@@ -31,9 +31,11 @@
/* Update the interrupt affinity and processor mask */
InterlockedBitTestAndSet(&HalpActiveProcessors, ProcessorNumber);
- InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity, ProcessorNumber);
+ InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity,
+ ProcessorNumber);
- /* FIXME: Register routines for KDCOM */
+ /* Register routines for KDCOM */
+ HalpRegisterKdSupportFunctions();
}
/*
Added: trunk/reactos/hal/halx86/generic/profil.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/profil.…
==============================================================================
--- trunk/reactos/hal/halx86/generic/profil.c (added)
+++ trunk/reactos/hal/halx86/generic/profil.c Thu Nov 30 01:12:50 2006
@@ -1,0 +1,48 @@
+/*
+ * PROJECT: ReactOS HAL
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: hal/halx86/generic/profil.c
+ * PURPOSE: System Profiling
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <hal.h>
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS *****************************************************************/
+
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource)
+{
+ KEBUGCHECK(0);
+ return;
+}
+
+/*
+ * @unimplemented
+ */
+VOID
+NTAPI
+HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource)
+{
+ KEBUGCHECK(0);
+ return;
+}
+
+/*
+ * @unimplemented
+ */
+ULONG_PTR
+NTAPI
+HalSetProfileInterval(IN ULONG_PTR Interval)
+{
+ KEBUGCHECK(0);
+ return Interval;
+}
Modified: trunk/reactos/hal/halx86/generic/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/sysinfo…
==============================================================================
--- trunk/reactos/hal/halx86/generic/sysinfo.c (original)
+++ trunk/reactos/hal/halx86/generic/sysinfo.c Thu Nov 30 01:12:50 2006
@@ -11,6 +11,8 @@
#include <hal.h>
#define NDEBUG
#include <debug.h>
+
+ULONG KdComPortInUse = 0;
/* FUNCTIONS *****************************************************************/
Modified: trunk/reactos/hal/halx86/include/halp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?…
==============================================================================
--- trunk/reactos/hal/halx86/include/halp.h (original)
+++ trunk/reactos/hal/halx86/include/halp.h Thu Nov 30 01:12:50 2006
@@ -9,10 +9,10 @@
#define KPCR_BASE 0xFF000000
/* WDK Hack */
-#define KdComPortInUse _KdComPortInUse
+#define KdComPortInUse _KdComPortInUse
-#define HAL_APC_REQUEST 0
-#define HAL_DPC_REQUEST 1
+#define HAL_APC_REQUEST 0
+#define HAL_DPC_REQUEST 1
/* CMOS Registers and Ports */
#define CMOS_CONTROL_PORT (PUCHAR)0x70
@@ -35,15 +35,6 @@
#define INT_BCD(int) \
(UCHAR)(((int / 10) << 4) + (int % 10))
-//
-// Kernel Debugger Port Definition
-//
-typedef struct _KD_PORT_INFORMATION
-{
- ULONG ComPort;
- ULONG BaudRate;
- ULONG BaseAddress;
-} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION;
/* adapter.c */
PADAPTER_OBJECT STDCALL HalpAllocateAdapterEx(ULONG NumberOfMapRegisters,BOOLEAN
IsMaster, BOOLEAN Dma32BitAddresses);
@@ -54,26 +45,63 @@
VOID NTAPI HalpInitPICs(VOID);
/* udelay.c */
-VOID HalpCalibrateStallExecution(VOID);
-
VOID NTAPI HalpInitializeClock(VOID);
/* pci.c */
VOID HalpInitPciBus (VOID);
-/* enum.c */
-VOID HalpStartEnumerator (VOID);
-
/* dma.c */
VOID HalpInitDma (VOID);
-
-/* mem.c */
-PVOID HalpMapPhysMemory(ULONG PhysAddr, ULONG Size);
/* Non-generic initialization */
VOID HalpInitPhase0 (PLOADER_PARAMETER_BLOCK LoaderBlock);
VOID HalpInitPhase1(VOID);
VOID NTAPI HalpClockInterrupt(VOID);
+
+//
+// KD Support
+//
+VOID
+NTAPI
+HalpCheckPowerButton(
+ VOID
+);
+
+VOID
+NTAPI
+HalpRegisterKdSupportFunctions(
+ VOID
+);
+
+NTSTATUS
+NTAPI
+HalpSetupPciDeviceForDebugging(
+ IN PVOID LoaderBlock,
+ IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice
+);
+
+NTSTATUS
+NTAPI
+HalpReleasePciDeviceForDebugging(
+ IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice
+);
+
+//
+// Memory routines
+//
+PVOID
+NTAPI
+HalpMapPhysicalMemory64(
+ IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN ULONG NumberPage
+);
+
+VOID
+NTAPI
+HalpUnmapVirtualAddress(
+ IN PVOID VirtualAddress,
+ IN ULONG NumberPages
+);
/* sysinfo.c */
NTSTATUS