Author: ion
Date: Wed Aug 23 21:28:39 2006
New Revision: 23670
URL:
http://svn.reactos.org/svn/reactos?rev=23670&view=rev
Log:
- [AUDIT] After spending some time looking at the current HAL, I believe it to be clean
and written by authors which had knowledge of system internals and have always used
clean-rooming. As well, the difference in implementation, complete and utter
incompatibility with NT as well as the presence of some Linux-based code confirms this.
- Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were
defined in the NDK in one way, but implemented another way, and since the HAL didn't
include its own NDK file, the compiler didn't realize this. Calls of these functions
might've experienced serious problems.
- Also fix HalHandleNmi and HalInitSystem definitions.
- Add stub code to actually setup the Clock Interrupt.
Added:
trunk/reactos/hal/halx86/generic/systimer.S
Modified:
trunk/reactos/hal/halx86/generic/beep.c (props changed)
trunk/reactos/hal/halx86/generic/bus.c (props changed)
trunk/reactos/hal/halx86/generic/display.c (props changed)
trunk/reactos/hal/halx86/generic/dma.c (props changed)
trunk/reactos/hal/halx86/generic/drive.c (props changed)
trunk/reactos/hal/halx86/generic/enum.c (props changed)
trunk/reactos/hal/halx86/generic/fmutex.c (props changed)
trunk/reactos/hal/halx86/generic/generic.rbuild
trunk/reactos/hal/halx86/generic/halinit.c (contents, props changed)
trunk/reactos/hal/halx86/generic/ipi.c (props changed)
trunk/reactos/hal/halx86/generic/isa.c (props changed)
trunk/reactos/hal/halx86/generic/kdbg.c (props changed)
trunk/reactos/hal/halx86/generic/mca.c (props changed)
trunk/reactos/hal/halx86/generic/misc.c (contents, props changed)
trunk/reactos/hal/halx86/generic/pci.c (props changed)
trunk/reactos/hal/halx86/generic/portio.c (props changed)
trunk/reactos/hal/halx86/generic/processor.c (props changed)
trunk/reactos/hal/halx86/generic/pwroff.c (props changed)
trunk/reactos/hal/halx86/generic/reboot.c (props changed)
trunk/reactos/hal/halx86/generic/resource.c (props changed)
trunk/reactos/hal/halx86/generic/spinlock.c (props changed)
trunk/reactos/hal/halx86/generic/sysbus.c (props changed)
trunk/reactos/hal/halx86/generic/sysinfo.c (props changed)
trunk/reactos/hal/halx86/generic/time.c (contents, props changed)
trunk/reactos/hal/halx86/generic/timer.c (props changed)
trunk/reactos/hal/halx86/include/hal.h
Propchange: trunk/reactos/hal/halx86/generic/beep.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/bus.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/display.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/dma.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/drive.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/enum.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/fmutex.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
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 Wed Aug 23 21:28:39 2006
@@ -35,6 +35,7 @@
<file>processor.c</file>
<file>resource.c</file>
<file>spinlock.c</file>
+ <file>systimer.S</file>
</module>
<module name="hal_generic_pc" type="objectlibrary">
<include base="hal_generic_pc">../include</include>
Modified: trunk/reactos/hal/halx86/generic/halinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit…
==============================================================================
--- trunk/reactos/hal/halx86/generic/halinit.c (original)
+++ trunk/reactos/hal/halx86/generic/halinit.c Wed Aug 23 21:28:39 2006
@@ -20,6 +20,8 @@
PVOID HalpZeroPageMapping = NULL;
HALP_HOOKS HalpHooks;
+VOID NTAPI HalpClockInterrupt(VOID);
+
/* FUNCTIONS ***************************************************************/
NTSTATUS
@@ -33,7 +35,7 @@
BOOLEAN STDCALL
HalInitSystem (ULONG BootPhase,
- PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
+ PLOADER_PARAMETER_BLOCK LoaderBlock)
{
if (BootPhase == 0)
{
@@ -42,6 +44,15 @@
}
else if (BootPhase == 1)
{
+#if 0
+ /* Enable the clock interrupt */
+ ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].ExtendedOffset =
+ (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF);
+ ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].Offset =
+ (USHORT)HalpClockInterrupt;
+ HalEnableSystemInterrupt(IRQ2VECTOR(0), CLOCK2_LEVEL, Latched);
+#endif
+
/* Initialize display and make the screen black */
HalInitializeDisplay ((PROS_LOADER_PARAMETER_BLOCK)LoaderBlock);
HalpInitBusHandlers();
Propchange: trunk/reactos/hal/halx86/generic/halinit.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/ipi.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/isa.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/kdbg.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/mca.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
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 Wed Aug 23 21:28:39 2006
@@ -26,7 +26,7 @@
VOID STDCALL
-HalHandleNMI(ULONG Unused)
+HalHandleNMI(PVOID NmiInfo)
{
UCHAR ucStatus;
Propchange: trunk/reactos/hal/halx86/generic/misc.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/pci.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/portio.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/processor.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/pwroff.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/reboot.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/resource.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/spinlock.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/sysbus.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/sysinfo.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Added: trunk/reactos/hal/halx86/generic/systimer.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systime…
==============================================================================
--- trunk/reactos/hal/halx86/generic/systimer.S (added)
+++ trunk/reactos/hal/halx86/generic/systimer.S Wed Aug 23 21:28:39 2006
@@ -1,0 +1,24 @@
+/*
+ * FILE: hal/halx86/generic/timer.S
+ * COPYRIGHT: See COPYING in the top level directory
+ * PURPOSE: System Timer Interrupt and Management
+ * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <asm.h>
+#include <internal/i386/asmmacro.S>
+.intel_syntax noprefix
+
+.extern _Kei386EoiHelper@0
+
+/* GLOBALS *******************************************************************/
+
+/* FUNCTIONS *****************************************************************/
+
+.globl _HalpClockInterrupt@0
+.func HalpClockInterrupt@0
+_HalpClockInterrupt@0:
+
+.endfunc
Modified: trunk/reactos/hal/halx86/generic/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/time.c?…
==============================================================================
--- trunk/reactos/hal/halx86/generic/time.c (original)
+++ trunk/reactos/hal/halx86/generic/time.c Wed Aug 23 21:28:39 2006
@@ -120,7 +120,7 @@
}
-VOID STDCALL
+BOOLEAN STDCALL
HalQueryRealTimeClock(PTIME_FIELDS Time)
{
KIRQL oldIrql;
@@ -162,6 +162,7 @@
#endif
Time->Milliseconds = 0;
+ return TRUE;
}
@@ -188,14 +189,13 @@
HalpSetCMOS (RTC_REGISTER_CENTURY, INT_BCD(Time->Year / 100));
#endif
KeReleaseSpinLock(&CmosLock, oldIrql);
-
}
BOOLEAN STDCALL
HalGetEnvironmentVariable(PCH Name,
- PCH Value,
- USHORT ValueLength)
+ USHORT ValueLength,
+ PCH Value)
{
KIRQL oldIrql;
Propchange: trunk/reactos/hal/halx86/generic/time.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Propchange: trunk/reactos/hal/halx86/generic/timer.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*
Modified: trunk/reactos/hal/halx86/include/hal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/hal.h?r…
==============================================================================
--- trunk/reactos/hal/halx86/include/hal.h (original)
+++ trunk/reactos/hal/halx86/include/hal.h Wed Aug 23 21:28:39 2006
@@ -17,6 +17,7 @@
#include <arc/arc.h>
#include <iotypes.h>
#include <kefuncs.h>
+#include <halfuncs.h>
#include <rosldr.h>
#define KPCR_BASE 0xFF000000 // HACK!