Author: tkreuzer
Date: Sat Sep 10 18:58:01 2011
New Revision: 53675
URL:
http://svn.reactos.org/svn/reactos?rev=53675&view=rev
Log:
[HAL]
- Use a global variable HalpBuildType instead of a define when checking the BUILD (we
don't recompile this code for SMP hal)
- Move registering IRQ2 out of the generic init code into HalInitializePICs
- Modify legacy HalpGetRootInterruptVector to use HalpIrqToVector and HalpVectorToIrql so
it works with APIC, too
Modified:
trunk/reactos/hal/halx86/generic/halinit.c
trunk/reactos/hal/halx86/include/halp.h
trunk/reactos/hal/halx86/legacy/bus/sysbus.c
trunk/reactos/hal/halx86/mp/halinit_mp.c
trunk/reactos/hal/halx86/up/halinit_up.c
trunk/reactos/hal/halx86/up/pic.c
trunk/reactos/hal/halx86/xbox/halinit_xbox.c
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 [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -90,10 +90,10 @@
}
/* Checked/free HAL requires checked/free kernel */
- if (Prcb->BuildType != HAL_BUILD_TYPE)
+ if (Prcb->BuildType != HalpBuildType)
{
/* No match, bugcheck */
- KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, HAL_BUILD_TYPE, 0);
+ KeBugCheckEx(MISMATCHED_HAL, 2, Prcb->BuildType, HalpBuildType, 0);
}
/* Initialize ACPI */
@@ -117,12 +117,6 @@
HalGetInterruptTranslator = NULL; // FIXME: TODO
HalResetDisplay = HalpBiosDisplayReset;
HalHaltSystem = HaliHaltSystem;
-
- /* Register IRQ 2 */
- HalpRegisterVector(IDT_INTERNAL,
- PRIMARY_VECTOR_BASE + 2,
- PRIMARY_VECTOR_BASE + 2,
- HIGH_LEVEL);
/* Setup I/O space */
HalpDefaultIoSpace.Next = HalpAddressUsageList;
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 [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -883,3 +883,4 @@
extern IDTUsageFlags HalpIDTUsageFlags[MAXIMUM_IDTVECTOR+1];
+extern const USHORT HalpBuildType;
Modified: trunk/reactos/hal/halx86/legacy/bus/sysbus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/legacy/bus/sysb…
==============================================================================
--- trunk/reactos/hal/halx86/legacy/bus/sysbus.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/legacy/bus/sysbus.c [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -117,21 +117,21 @@
OUT PKIRQL Irql,
OUT PKAFFINITY Affinity)
{
- ULONG SystemVector;
-
- /* Get the system vector */
- SystemVector = PRIMARY_VECTOR_BASE + BusInterruptLevel;
-
- /* Validate it */
- if ((SystemVector < PRIMARY_VECTOR_BASE) || (SystemVector > PRIMARY_VECTOR_BASE
+ 27))
+ UCHAR SystemVector;
+
+ /* Validate the IRQ */
+ if (BusInterruptLevel > 23)
{
/* Invalid vector */
- DPRINT1("Vector %lx is too low or too high!\n", SystemVector);
+ DPRINT1("IRQ %lx is too high!\n", BusInterruptLevel);
return 0;
}
-
+
+ /* Get the system vector */
+ SystemVector = HalpIrqToVector((UCHAR)BusInterruptLevel);
+
/* Return the IRQL and affinity */
- *Irql = (PRIMARY_VECTOR_BASE + 27) - SystemVector;
+ *Irql = HalpVectorToIrql(SystemVector);
*Affinity = HalpDefaultInterruptAffinity;
ASSERT(HalpDefaultInterruptAffinity);
Modified: trunk/reactos/hal/halx86/mp/halinit_mp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/mp/halinit_mp.c…
==============================================================================
--- trunk/reactos/hal/halx86/mp/halinit_mp.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/mp/halinit_mp.c [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -15,12 +15,13 @@
#define NDEBUG
#include <debug.h>
-/* FUNCTIONS ***************************************************************/
+/* GLOBALS ******************************************************************/
+const USHORT HalpBuildType = HAL_BUILD_TYPE;
extern BOOLEAN HaliFindSmpConfig(VOID);
ULONG_PTR KernelBase;
-/***************************************************************************/
+/* FUNCTIONS ****************************************************************/
VOID NTAPI HalpInitializePICs(IN BOOLEAN EnableInterrupts)
{
Modified: trunk/reactos/hal/halx86/up/halinit_up.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/halinit_up.c…
==============================================================================
--- trunk/reactos/hal/halx86/up/halinit_up.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/up/halinit_up.c [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -15,7 +15,11 @@
#define NDEBUG
#include <debug.h>
-/* FUNCTIONS ***************************************************************/
+/* GLOBALS ******************************************************************/
+
+const USHORT HalpBuildType = HAL_BUILD_TYPE;
+
+/* FUNCTIONS ****************************************************************/
VOID
NTAPI
Modified: trunk/reactos/hal/halx86/up/pic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/pic.c?rev=53…
==============================================================================
--- trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -507,6 +507,12 @@
}
}
+ /* Register IRQ 2 */
+ HalpRegisterVector(IDT_INTERNAL,
+ PRIMARY_VECTOR_BASE + 2,
+ PRIMARY_VECTOR_BASE + 2,
+ HIGH_LEVEL);
+
/* Restore interrupt state */
if (EnableInterrupts) EFlags |= EFLAGS_INTERRUPT_MASK;
__writeeflags(EFlags);
Modified: trunk/reactos/hal/halx86/xbox/halinit_xbox.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/xbox/halinit_xb…
==============================================================================
--- trunk/reactos/hal/halx86/xbox/halinit_xbox.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/xbox/halinit_xbox.c [iso-8859-1] Sat Sep 10 18:58:01 2011
@@ -15,6 +15,8 @@
#define NDEBUG
#include <debug.h>
+
+const USHORT HalpBuildType = HAL_BUILD_TYPE;
/* FUNCTIONS ***************************************************************/