https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3306a16e846359b5712e1…
commit 3306a16e846359b5712e15d0c9446ea4a6971ff4
Author: Justin Miller <justin.miller(a)reactos.org>
AuthorDate: Sat Jan 20 06:26:59 2024 -0800
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Jan 20 06:26:59 2024 -0800
[HALX86] Fix SYNCH_LEVEL differences between UP and SMP in HAL (#5874)
First step to fixing the multiprocessor kernel when booting on a single core.
---
hal/halx86/generic/buildtype.c | 8 +++++++-
hal/halx86/include/halp.h | 8 ++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/hal/halx86/generic/buildtype.c b/hal/halx86/generic/buildtype.c
index 2aad63360f9..49d7df8f226 100644
--- a/hal/halx86/generic/buildtype.c
+++ b/hal/halx86/generic/buildtype.c
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS Hardware Abstraction Layer
* LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
-* PURPOSE: Defines HalpBuildType for either UP or SMP
+* PURPOSE: Defines differences for either UP or SMP
* COPYRIGHT: Copyright 2021 Timo Kreuzer <timo.kreuzer(a)reactos.org>
*/
@@ -12,3 +12,9 @@
/* GLOBALS ******************************************************************/
const USHORT HalpBuildType = HAL_BUILD_TYPE;
+
+#ifdef CONFIG_SMP
+KIRQL HalpIrqlSynchLevel = IPI_LEVEL - 2;
+#else
+KIRQL HalpIrqlSynchLevel = DISPATCH_LEVEL;
+#endif
diff --git a/hal/halx86/include/halp.h b/hal/halx86/include/halp.h
index cc55c15b847..72e09fdb28f 100644
--- a/hal/halx86/include/halp.h
+++ b/hal/halx86/include/halp.h
@@ -10,6 +10,14 @@
#define HAL_BUILD_TYPE ((DBG ? PRCB_BUILD_DEBUG : 0) | PRCB_BUILD_UNIPROCESSOR)
#endif
+/* Don't include this in freeloader */
+#ifndef _BLDR_
+extern KIRQL HalpIrqlSynchLevel;
+
+#undef SYNCH_LEVEL
+#define SYNCH_LEVEL HalpIrqlSynchLevel
+#endif
+
typedef struct _HAL_BIOS_FRAME
{
ULONG SegSs;