Author: tkreuzer
Date: Thu Dec 31 20:26:37 2009
New Revision: 44832
URL:
http://svn.reactos.org/svn/reactos?rev=44832&view=rev
Log:
[HAL]
some improvements
Modified:
branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c
branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h
branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c
Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
==============================================================================
--- branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/hal/halamd64/generic/halinit.c [iso-8859-1] Thu Dec
31 20:26:37 2009
@@ -62,7 +62,7 @@
PKPRCB Prcb = KeGetCurrentPrcb();
/* Check the boot phase */
- if (!BootPhase)
+ if (BootPhase == 0)
{
/* Phase 0... save bus type */
HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF;
@@ -70,8 +70,8 @@
/* Get command-line parameters */
HalpGetParameters(LoaderBlock);
+#if DBG
/* Checked HAL requires checked kernel */
-#if DBG
if (!(Prcb->BuildType & PRCB_BUILD_DEBUG))
{
/* No match, bugcheck */
@@ -101,18 +101,21 @@
/* Validation failed, bugcheck */
KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0);
}
-DPRINT1("HalInitSystem 2\n");
+
+ DPRINT1("HalInitSystem 1\n");
+
/* Initialize the PICs */
HalpInitPICs();
-DPRINT1("HalInitSystem 3\n");
- /* Force initial PIC state */
- KfRaiseIrql(KeGetCurrentIrql());
-DPRINT1("HalInitSystem 4\n");
+
+ DPRINT1("HalInitSystem 2\n");
+
/* Initialize the clock */
HalpInitializeClock();
-DPRINT1("HalInitSystem 5\n");
- /* Setup busy waiting */
- //HalpCalibrateStallExecution();
+
+ DPRINT1("HalInitSystem 3\n");
+
+ /* Calibrate counters */
+// HalpCalibrateCounters();
/* Fill out the dispatch tables */
HalQuerySystemInformation = HaliQuerySystemInformation;
@@ -121,7 +124,9 @@
// HalGetDmaAdapter = HalpGetDmaAdapter;
HalGetInterruptTranslator = NULL; // FIXME: TODO
// HalResetDisplay = HalpBiosDisplayReset;
-DPRINT1("HalInitSystem 6\n");
+
+ DPRINT1("HalInitSystem 4\n");
+
/* Initialize the hardware lock (CMOS) */
KeInitializeSpinLock(&HalpSystemHardwareLock);
@@ -134,11 +139,8 @@
//HalpInitBusHandler();
/* Enable the clock interrupt */
- PKIDTENTRY64 IdtEntry = &((PKIPCR)KeGetPcr())->IdtBase[0x30];
- IdtEntry->OffsetLow = (((ULONG_PTR)HalpClockInterrupt) & 0xFFFF);
- IdtEntry->OffsetMiddle = (((ULONG_PTR)HalpClockInterrupt >> 16) &
0xFFFF);
- IdtEntry->OffsetHigh = ((ULONG_PTR)HalpClockInterrupt >> 32);
-// HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched);
+ HalpSetInterruptGate(0x30, HalpClockInterrupt);
+ HalEnableSystemInterrupt(0x30, CLOCK_LEVEL, Latched);
/* Initialize DMA. NT does this in Phase 0 */
HalpInitDma();
Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
==============================================================================
--- branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/hal/halamd64/include/halp.h [iso-8859-1] Thu Dec 31
20:26:37 2009
@@ -164,6 +164,10 @@
VOID HaliInitBSP(VOID);
VOID HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack);
+VOID NTAPI HalpInitIdtEntry(PKIDTENTRY64 Idt, PVOID Address);
+VOID NTAPI HalpSetInterruptGate(ULONG Index, PVOID Address);
+VOID NTAPI HalpInitCpuInterruptHandling(ULONG Cpu);
+
extern PVOID HalpRealModeStart;
extern PVOID HalpRealModeEnd;
Modified: branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
==============================================================================
--- branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/hal/halamd64/up/processor.c [iso-8859-1] Thu Dec 31
20:26:37 2009
@@ -25,8 +25,7 @@
HalInitializeProcessor(IN ULONG ProcessorNumber,
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
- /* Set default IDR and stall count */
-// KeGetPcr()->IDR = 0xFFFFFFFB;
+ /* Set default stall count */
KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
/* Update the interrupt affinity and processor mask */
@@ -36,6 +35,9 @@
/* Register routines for KDCOM */
HalpRegisterKdSupportFunctions();
+
+ /* Do per CPU interrupt handling initialization */
+// HalpInitCpuInterruptHandling(ProcessorNumber);
}
/*