Reorganise HAL so multiple HAL versions can be built in parallel
authorGé van Geldorp <ge@gse.nl>
Fri, 3 Dec 2004 20:10:45 +0000 (20:10 +0000)
committerGé van Geldorp <ge@gse.nl>
Fri, 3 Dec 2004 20:10:45 +0000 (20:10 +0000)
svn path=/trunk/; revision=11909

46 files changed:
reactos/Makefile
reactos/hal/halx86/generic/adapter.c [moved from reactos/hal/halx86/adapter.c with 99% similarity]
reactos/hal/halx86/generic/beep.c [moved from reactos/hal/halx86/beep.c with 100% similarity]
reactos/hal/halx86/generic/bus.c [moved from reactos/hal/halx86/bus.c with 99% similarity]
reactos/hal/halx86/generic/display.c [moved from reactos/hal/halx86/display.c with 99% similarity]
reactos/hal/halx86/generic/dma.c [moved from reactos/hal/halx86/dma.c with 99% similarity]
reactos/hal/halx86/generic/drive.c [moved from reactos/hal/halx86/drive.c with 93% similarity]
reactos/hal/halx86/generic/enum.c [moved from reactos/hal/halx86/enum.c with 87% similarity]
reactos/hal/halx86/generic/fmutex.c [moved from reactos/hal/halx86/fmutex.c with 95% similarity]
reactos/hal/halx86/generic/halinit.c [moved from reactos/hal/halx86/halinit.c with 83% similarity]
reactos/hal/halx86/generic/ipi.c [new file with mode: 0644]
reactos/hal/halx86/generic/irql.c [moved from reactos/hal/halx86/irql.c with 99% similarity]
reactos/hal/halx86/generic/isa.c [moved from reactos/hal/halx86/isa.c with 95% similarity]
reactos/hal/halx86/generic/kdbg.c [moved from reactos/hal/halx86/kdbg.c with 99% similarity]
reactos/hal/halx86/generic/mca.c [moved from reactos/hal/halx86/mca.c with 97% similarity]
reactos/hal/halx86/generic/misc.c [moved from reactos/hal/halx86/misc.c with 67% similarity]
reactos/hal/halx86/generic/pci.c [moved from reactos/hal/halx86/pci.c with 99% similarity]
reactos/hal/halx86/generic/portio.c [moved from reactos/hal/halx86/portio.c with 99% similarity]
reactos/hal/halx86/generic/processor.c [new file with mode: 0644]
reactos/hal/halx86/generic/pwroff.c [moved from reactos/hal/halx86/pwroff.c with 97% similarity]
reactos/hal/halx86/generic/reboot.c [moved from reactos/hal/halx86/reboot.c with 96% similarity]
reactos/hal/halx86/generic/resource.c [new file with mode: 0644]
reactos/hal/halx86/generic/spinlock.c [moved from reactos/hal/halx86/spinlock.c with 97% similarity]
reactos/hal/halx86/generic/sysbus.c [moved from reactos/hal/halx86/sysbus.c with 94% similarity]
reactos/hal/halx86/generic/sysinfo.c [moved from reactos/hal/halx86/sysinfo.c with 100% similarity]
reactos/hal/halx86/generic/time.c [moved from reactos/hal/halx86/time.c with 100% similarity]
reactos/hal/halx86/generic/timer.c [moved from reactos/hal/halx86/timer.c with 99% similarity]
reactos/hal/halx86/include/hal.h
reactos/hal/halx86/mp/.cvsignore [moved from reactos/hal/halx86/.cvsignore with 100% similarity]
reactos/hal/halx86/mp/Makefile [moved from reactos/hal/halx86/Makefile with 63% similarity]
reactos/hal/halx86/mp/apic.c [moved from reactos/hal/halx86/apic.c with 99% similarity]
reactos/hal/halx86/mp/halinit_mp.c [new file with mode: 0644]
reactos/hal/halx86/mp/halmp.rc [moved from reactos/hal/halx86/halx86mp.rc with 100% similarity]
reactos/hal/halx86/mp/ipi_mp.c [new file with mode: 0644]
reactos/hal/halx86/mp/mps.S [moved from reactos/hal/halx86/mps.S with 96% similarity]
reactos/hal/halx86/mp/mpsboot.asm [moved from reactos/hal/halx86/mpsboot.asm with 100% similarity]
reactos/hal/halx86/mp/mpsirql.c [moved from reactos/hal/halx86/mpsirql.c with 99% similarity]
reactos/hal/halx86/mp/processor_mp.c [moved from reactos/hal/halx86/mp.c with 99% similarity]
reactos/hal/halx86/mp/resource_mp.c [new file with mode: 0644]
reactos/hal/halx86/up/.cvsignore [new file with mode: 0644]
reactos/hal/halx86/up/Makefile [new file with mode: 0644]
reactos/hal/halx86/up/halinit_up.c [new file with mode: 0644]
reactos/hal/halx86/up/halup.rc [moved from reactos/hal/halx86/halx86up.rc with 58% similarity]
reactos/include/ddk/kefuncs.h
reactos/tools/helper.mk
reactos/tools/mkconfig.c

index 641d4ca..c53ed6d 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.266 2004/12/01 16:07:57 greatlrd Exp $
+# $Id: Makefile,v 1.267 2004/12/03 20:10:40 gvg Exp $
 #
 # Global makefile
 #
@@ -27,7 +27,7 @@ COMPONENTS = ntoskrnl
 
 # Hardware Abstraction Layers
 # halx86
-HALS = halx86
+HALS = halx86/up halx86/mp
 
 # Bus drivers
 # acpi isapnp pci
similarity index 99%
rename from reactos/hal/halx86/adapter.c
rename to reactos/hal/halx86/generic/adapter.c
index 1908758..8ad0443 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: adapter.c,v 1.14 2004/11/24 17:54:38 navaraf Exp $
+/* $Id: adapter.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 99%
rename from reactos/hal/halx86/bus.c
rename to reactos/hal/halx86/generic/bus.c
index d379db7..bc6a414 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bus.c,v 1.7 2003/12/28 22:38:09 fireball Exp $
+/* $Id: bus.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 99%
rename from reactos/hal/halx86/display.c
rename to reactos/hal/halx86/generic/display.c
index b23b4a0..66ed8a4 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: display.c,v 1.18 2004/10/31 19:45:16 ekohl Exp $
+/* $Id: display.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 99%
rename from reactos/hal/halx86/dma.c
rename to reactos/hal/halx86/generic/dma.c
index 5d010b8..c84921f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dma.c,v 1.10 2004/11/21 21:53:06 ion Exp $
+/* $Id: dma.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 93%
rename from reactos/hal/halx86/drive.c
rename to reactos/hal/halx86/generic/drive.c
index 29f0a20..edfe3d5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drive.c,v 1.4 2003/02/26 14:14:03 ekohl Exp $
+/* $Id: drive.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 87%
rename from reactos/hal/halx86/enum.c
rename to reactos/hal/halx86/generic/enum.c
index c5147cd..1855d5a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: enum.c,v 1.5 2002/09/08 10:22:24 chorns Exp $
+/* $Id: enum.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -12,7 +12,6 @@
 /* INCLUDES *****************************************************************/
 
 #include <ddk/ntddk.h>
-#include <roscfg.h>
 
 #define NDEBUG
 #include <internal/debug.h>
similarity index 95%
rename from reactos/hal/halx86/fmutex.c
rename to reactos/hal/halx86/generic/fmutex.c
index 9254dc8..bc9c84d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fmutex.c,v 1.5 2002/09/08 10:22:24 chorns Exp $
+/* $Id: fmutex.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 83%
rename from reactos/hal/halx86/halinit.c
rename to reactos/hal/halx86/generic/halinit.c
index f1e030e..5fab4d7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: halinit.c,v 1.10 2004/11/28 01:30:01 hbirr Exp $
+/* $Id: halinit.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:     See COPYING in the top level directory
  * PROJECT:       ReactOS kernel
 /* INCLUDES *****************************************************************/
 
 #include <ddk/ntddk.h>
-#include <roscfg.h>
 #include <hal.h>
 
-#ifdef MP
-#include <mps.h>
-#endif /* MP */
-
 #define NDEBUG
 #include <internal/debug.h>
 
@@ -45,20 +40,8 @@ HalInitSystem (ULONG BootPhase,
     {
       /* Initialize display and make the screen black */
       HalInitializeDisplay (LoaderBlock);
-      
-#ifdef MP
-      
-      HalpInitMPS();
-      
-#else
-
-      HalpInitPICs();
-
-      /* Setup busy waiting */
-      HalpCalibrateStallExecution();
-
-#endif /* MP */
 
+      HalpInitPhase0();      
     }
   else if (BootPhase == 1)
     {
diff --git a/reactos/hal/halx86/generic/ipi.c b/reactos/hal/halx86/generic/ipi.c
new file mode 100644 (file)
index 0000000..9ec5a0e
--- /dev/null
@@ -0,0 +1,26 @@
+/* $Id: ipi.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
+ *
+ * COPYRIGHT:             See COPYING in the top level directory
+ * PROJECT:               ReactOS kernel
+ * FILE:                  hal/halx86/generic/ipi.c
+ * PURPOSE:               Miscellaneous hardware functions
+ * PROGRAMMER:            Eric Kohl (ekohl@rz-online.de)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+/* FUNCTIONS ****************************************************************/
+
+VOID STDCALL
+HalRequestIpi(ULONG ProcessorNo)
+{
+  DPRINT("HalRequestIpi(ProcessorNo %d)\n", ProcessorNo);
+}
+
+/* EOF */
similarity index 99%
rename from reactos/hal/halx86/irql.c
rename to reactos/hal/halx86/generic/irql.c
index 3a39a33..10264ac 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: irql.c,v 1.22 2004/11/21 21:53:06 ion Exp $
+/* $Id: irql.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -9,7 +9,6 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <internal/ps.h>
 #include <ntos/minmax.h>
similarity index 95%
rename from reactos/hal/halx86/isa.c
rename to reactos/hal/halx86/generic/isa.c
index a694ccf..81f4e56 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: isa.c,v 1.7 2004/11/01 14:37:19 hbirr Exp $
+/* $Id: isa.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -11,7 +11,6 @@
 
 /* INCLUDES ***************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <bus.h>
 #include <halirq.h>
similarity index 99%
rename from reactos/hal/halx86/kdbg.c
rename to reactos/hal/halx86/generic/kdbg.c
index 6e55bc2..93b10fa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: kdbg.c,v 1.8 2004/04/29 17:06:21 navaraf Exp $
+/* $Id: kdbg.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 97%
rename from reactos/hal/halx86/mca.c
rename to reactos/hal/halx86/generic/mca.c
index dc09835..9aa7c68 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: mca.c,v 1.3 2003/12/28 22:38:09 fireball Exp $
+/* $Id: mca.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS kernel
similarity index 67%
rename from reactos/hal/halx86/misc.c
rename to reactos/hal/halx86/generic/misc.c
index 4339d80..a94d747 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.8 2004/11/28 01:30:01 hbirr Exp $
+/* $Id: misc.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:             See COPYING in the top level directory
  * PROJECT:               ReactOS kernel
@@ -9,26 +9,14 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <hal.h>
 
-#ifdef MP
-#include <apic.h>
-#endif
-
 #define NDEBUG
 #include <internal/debug.h>
 
 /* FUNCTIONS ****************************************************************/
 
-#ifdef MP
-
-VOID
-HaliReconfigurePciInterrupts(VOID);
-
-#endif
-
 VOID STDCALL
 HalHandleNMI(ULONG Unused)
 {
@@ -61,16 +49,6 @@ HalProcessorIdle(VOID)
 #endif
 }
 
-VOID STDCALL
-HalRequestIpi(ULONG ProcessorNo)
-{
-  DPRINT("HalRequestIpi(ProcessorNo %d)\n", ProcessorNo);
-#ifdef MP 
-  APICSendIPI(1 << ProcessorNo,
-             IPI_VECTOR|APIC_ICR0_LEVEL_DEASSERT|APIC_ICR0_DESTM);
-#endif
-}
-
 ULONG FASTCALL
 HalSystemVectorDispatchEntry (
        ULONG   Unknown1,
@@ -88,22 +66,4 @@ KeFlushWriteBuffer(VOID)
   return;
 }
 
-
-VOID STDCALL
-HalReportResourceUsage(VOID)
-{
-  /*
-   * FIXME: Report all resources used by hal.
-   *        Calls IoReportHalResourceUsage()
-   */
-
-  /* Initialize PCI bus. */
-  HalpInitPciBus ();
-#ifdef MP
-
-  HaliReconfigurePciInterrupts();
-#endif
-
-}
-
 /* EOF */
similarity index 99%
rename from reactos/hal/halx86/pci.c
rename to reactos/hal/halx86/generic/pci.c
index 46770af..79d58aa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pci.c,v 1.14 2004/11/15 09:18:19 ekohl Exp $
+/* $Id: pci.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -18,7 +18,6 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <bus.h>
 #include <halirq.h>
similarity index 99%
rename from reactos/hal/halx86/portio.c
rename to reactos/hal/halx86/generic/portio.c
index a308efe..63e1cac 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: portio.c,v 1.4 2003/12/28 22:38:09 fireball Exp $
+/* $Id: portio.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
diff --git a/reactos/hal/halx86/generic/processor.c b/reactos/hal/halx86/generic/processor.c
new file mode 100644 (file)
index 0000000..36b151a
--- /dev/null
@@ -0,0 +1,50 @@
+/* $Id: processor.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
+ *
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS kernel
+ * FILE:            hal/halx86/generic/processor.c
+ * PURPOSE:         Intel MultiProcessor specification support
+ * PROGRAMMER:      David Welch (welch@cwcom.net)
+ *                  Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * NOTES:           Parts adapted from linux SMP code
+ * UPDATE HISTORY:
+ *     22/05/1998  DW   Created
+ *     12/04/2001  CSH  Added MultiProcessor specification support
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+
+/* FUNCTIONS *****************************************************************/
+
+VOID STDCALL
+HalInitializeProcessor(ULONG ProcessorNumber,
+                      PVOID /*PLOADER_PARAMETER_BLOCK*/ LoaderBlock)
+{
+  DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber, LoaderBlock);
+}
+
+BOOLEAN STDCALL
+HalAllProcessorsStarted (VOID)
+{
+  DPRINT("HalAllProcessorsStarted()\n");
+
+  return TRUE;
+}
+
+BOOLEAN STDCALL 
+HalStartNextProcessor(ULONG Unknown1,
+                     ULONG ProcessorStack)
+{
+  DPRINT("HalStartNextProcessor(%x %x)\n", ProcessorNumber, ProcessorStack);
+
+  return TRUE;
+}
+
+/* EOF */
similarity index 97%
rename from reactos/hal/halx86/pwroff.c
rename to reactos/hal/halx86/generic/pwroff.c
index 89ddf79..a962d7b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pwroff.c,v 1.4 2003/12/28 22:38:09 fireball Exp $
+/* $Id: pwroff.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * FILE       : reactos/hal/x86/apm.c
  * DESCRIPTION: Turn CPU off...
similarity index 96%
rename from reactos/hal/halx86/reboot.c
rename to reactos/hal/halx86/generic/reboot.c
index 76f444c..cdd6501 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: reboot.c,v 1.7 2004/07/20 21:25:36 hbirr Exp $
+/* $Id: reboot.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
diff --git a/reactos/hal/halx86/generic/resource.c b/reactos/hal/halx86/generic/resource.c
new file mode 100644 (file)
index 0000000..a2cfd3b
--- /dev/null
@@ -0,0 +1,32 @@
+/* $Id: resource.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
+ *
+ * COPYRIGHT:             See COPYING in the top level directory
+ * PROJECT:               ReactOS kernel
+ * FILE:                  hal/halx86/generic/resource.c
+ * PURPOSE:               Miscellaneous resource functions
+ * PROGRAMMER:            Eric Kohl (ekohl@rz-online.de)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+/* FUNCTIONS ****************************************************************/
+
+VOID STDCALL
+HalReportResourceUsage(VOID)
+{
+  /*
+   * FIXME: Report all resources used by hal.
+   *        Calls IoReportHalResourceUsage()
+   */
+
+  /* Initialize PCI bus. */
+  HalpInitPciBus ();
+}
+
+/* EOF */
similarity index 97%
rename from reactos/hal/halx86/spinlock.c
rename to reactos/hal/halx86/generic/spinlock.c
index d4f4cbf..144344c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: spinlock.c,v 1.9 2004/10/22 20:08:22 ekohl Exp $
+/* $Id: spinlock.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
similarity index 94%
rename from reactos/hal/halx86/sysbus.c
rename to reactos/hal/halx86/generic/sysbus.c
index ca5e916..cb29224 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sysbus.c,v 1.7 2004/11/01 14:37:19 hbirr Exp $
+/* $Id: sysbus.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -11,7 +11,6 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <bus.h>
 #include <halirq.h>
similarity index 99%
rename from reactos/hal/halx86/timer.c
rename to reactos/hal/halx86/generic/timer.c
index 70a3e4f..57e54c5 100644 (file)
@@ -20,7 +20,7 @@
  * MA 02139, USA.  
  *
  */
-/* $Id: timer.c,v 1.8 2004/11/28 01:30:01 hbirr Exp $
+/* $Id: timer.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
  *
  * PROJECT:        ReactOS kernel
  * FILE:           ntoskrnl/hal/x86/udelay.c
@@ -32,7 +32,6 @@
 
 /* INCLUDES ***************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <internal/ps.h>
 #include <hal.h>
index 8635945..88d382e 100644 (file)
@@ -33,6 +33,9 @@ VOID HalpStartEnumerator (VOID);
 /* dma.c */
 VOID HalpInitDma (VOID);
 
+/* Non-generic initialization */
+VOID HalpInitPhase0 (VOID);
+
 /* DMA Page Register Structure  
  080     DMA        RESERVED
  081     DMA        Page Register (channel 2)
similarity index 63%
rename from reactos/hal/halx86/Makefile
rename to reactos/hal/halx86/mp/Makefile
index 6727304..65f85f5 100644 (file)
@@ -1,6 +1,8 @@
-# $Id: Makefile,v 1.15 2004/11/28 01:30:01 hbirr Exp $
+# $Id: Makefile,v 1.1 2004/12/03 20:10:44 gvg Exp $
 
-PATH_TO_TOP = ../..
+PATH_TO_TOP = ../../..
+
+VPATH = ../generic
 
 default: all
 
@@ -14,33 +16,26 @@ include $(PATH_TO_TOP)/rules.mak
 #
 include $(TOOLS_PATH)/config.mk
 
-TARGET_BOOTSTRAP = yes
-
 TARGET_TYPE = hal
 
-TARGET_BASENAME = hal
+TARGET_DEFNAME = ../../hal/hal
 
-TARGET_DEFNAME = ../hal/hal
+TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ASM__ -DMP
 
-TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ASM__
-
-TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/ntoskrnl/include -Wall -Werror
+TARGET_CFLAGS = -I../include -I$(PATH_TO_TOP)/ntoskrnl/include -Wall -Werror -DMP
 
 # require os code to explicitly request A/W version of structs/functions
 TARGET_CFLAGS += -D_DISABLE_TIDENTS
 
+TARGET_NAME = halmp
 
-TARGET_NAME_UP = halx86up
-
-TARGET_NAME_MP = halx86mp
-
-ifeq ($(MP), 1)
-TARGET_NAME = $(TARGET_NAME_MP)
+ifneq ($(MP), 1)
+TARGET_INSTALL = no
 else
-TARGET_NAME = $(TARGET_NAME_UP)
+TARGET_BOOTSTRAP = yes
 endif
 
-HAL_OBJECTS = \
+GENERIC_OBJECTS = \
        adapter.o \
        beep.o \
        bus.o \
@@ -54,7 +49,6 @@ HAL_OBJECTS = \
        kdbg.o \
        mca.o \
        misc.o \
-       mp.o \
        pci.o \
        portio.o \
        reboot.o \
@@ -64,24 +58,19 @@ HAL_OBJECTS = \
        time.o \
        timer.o
 
-       #pwroff.o
-
-HAL_UP = \
-  $(HAL_OBJECTS) \
-       irql.o  
-
-HAL_MP = \
-  $(HAL_OBJECTS) \
+MP_OBJECTS = \
        apic.o \
+       halinit_mp.o \
+       ipi_mp.o \
        mpsirql.o \
        mpsboot.o \
-       mps.o
+       mps.o \
+       processor_mp.o \
+       resource_mp.o
 
-ifeq ($(MP), 1)
-DEP_OBJECTS := $(HAL_MP)
-else
-DEP_OBJECTS := $(HAL_UP)
-endif
+HAL_OBJECTS = $(GENERIC_OBJECTS) $(MP_OBJECTS)
+
+DEP_OBJECTS := $(HAL_OBJECTS)
 
 TARGET_OBJECTS := $(DEP_OBJECTS) $(PATH_TO_TOP)/include/roscfg.h
 
similarity index 99%
rename from reactos/hal/halx86/apic.c
rename to reactos/hal/halx86/mp/apic.c
index b045eb6..91bc774 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: apic.c,v 1.1 2004/11/28 01:30:01 hbirr Exp $
+/* $Id: apic.c,v 1.1 2004/12/03 20:10:44 gvg Exp $
  *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS kernel
@@ -25,8 +25,8 @@
  * PROGRAMMER:  
  */
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
+#include <internal/i386/ps.h>
 
 #include <hal.h>
 #include <halirq.h>
diff --git a/reactos/hal/halx86/mp/halinit_mp.c b/reactos/hal/halx86/mp/halinit_mp.c
new file mode 100644 (file)
index 0000000..57c0065
--- /dev/null
@@ -0,0 +1,29 @@
+/* $Id: halinit_mp.c,v 1.1 2004/12/03 20:10:44 gvg Exp $
+ *
+ * COPYRIGHT:     See COPYING in the top level directory
+ * PROJECT:       ReactOS kernel
+ * FILE:          ntoskrnl/hal/x86/halinit.c
+ * PURPOSE:       Initalize the x86 hal
+ * PROGRAMMER:    David Welch (welch@cwcom.net)
+ * UPDATE HISTORY:
+ *              11/06/98: Created
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+#include <mps.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+/* FUNCTIONS ***************************************************************/
+
+VOID
+HalpInitPhase0(VOID)
+{
+  HalpInitMPS();
+}
+
+/* EOF */
diff --git a/reactos/hal/halx86/mp/ipi_mp.c b/reactos/hal/halx86/mp/ipi_mp.c
new file mode 100644 (file)
index 0000000..bbeab8d
--- /dev/null
@@ -0,0 +1,29 @@
+/* $Id: ipi_mp.c,v 1.1 2004/12/03 20:10:44 gvg Exp $
+ *
+ * COPYRIGHT:             See COPYING in the top level directory
+ * PROJECT:               ReactOS kernel
+ * FILE:                  hal/halx86/mp/ipi_mp.c
+ * PURPOSE:               IPI functions for MP
+ * PROGRAMMER:            Eric Kohl (ekohl@rz-online.de)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+#include <apic.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+/* FUNCTIONS ****************************************************************/
+
+VOID STDCALL
+HalRequestIpi(ULONG ProcessorNo)
+{
+  DPRINT("HalRequestIpi(ProcessorNo %d)\n", ProcessorNo);
+  APICSendIPI(1 << ProcessorNo,
+             IPI_VECTOR|APIC_ICR0_LEVEL_DEASSERT|APIC_ICR0_DESTM);
+}
+
+/* EOF */
similarity index 96%
rename from reactos/hal/halx86/mps.S
rename to reactos/hal/halx86/mp/mps.S
index 9ab3796..25f144b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mps.S,v 1.4 2004/11/28 01:30:01 hbirr Exp $
+/* $Id: mps.S,v 1.1 2004/12/03 20:10:44 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -16,7 +16,7 @@
 /* FUNCTIONS *****************************************************************/
 
 #define BEFORE \
-  cld; \       
+  cld; \
   pusha; \
   pushl %ds; \
   pushl %es; \
similarity index 99%
rename from reactos/hal/halx86/mpsirql.c
rename to reactos/hal/halx86/mp/mpsirql.c
index 45bc850..6ed7f05 100644 (file)
@@ -11,7 +11,6 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
 #include <internal/ke.h>
 #include <internal/ps.h>
similarity index 99%
rename from reactos/hal/halx86/mp.c
rename to reactos/hal/halx86/mp/processor_mp.c
index 8c1add0..0b11e73 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: mp.c,v 1.12 2004/11/28 01:30:01 hbirr Exp $
+/* $Id: processor_mp.c,v 1.1 2004/12/03 20:10:44 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
- * FILE:            ntoskrnl/hal/x86/mp.c
+ * FILE:            hal/halx86/mp/processor_mp.c
  * PURPOSE:         Intel MultiProcessor specification support
  * PROGRAMMER:      David Welch (welch@cwcom.net)
  *                  Casper S. Hornstrup (chorns@users.sourceforge.net)
 
 /* INCLUDES *****************************************************************/
 
-#include <roscfg.h>
 #include <ddk/ntddk.h>
-
-
-#ifdef MP
-
 #include <hal.h>
 #include <halirq.h>
 #include <mps.h>
 #include <internal/ke.h>
 #include <internal/ps.h>
 
-#endif
-
 #define NDEBUG
 #include <internal/debug.h>
 
-#ifdef MP
-
-
 /*
    Address of area to be used for communication between Application
    Processors (APs) and the BootStrap Processor (BSP)
@@ -91,14 +81,9 @@ extern VOID MpsIpiInterrupt(VOID);
    WRITE_PORT_UCHAR((PUCHAR)0x71, value); \
 })
 
-#endif /* MP */
-
-
 
 /* FUNCTIONS *****************************************************************/
 
-#ifdef MP
-
 /* Functions for handling 8259A PICs */
 
 VOID Disable8259AIrq(ULONG irq)
@@ -1003,19 +988,14 @@ SetInterruptGate(ULONG index, ULONG address)
   idt->b = 0x8e00 + (((ULONG)address)&0xffff0000);
 }
 
-#endif /* MP */
-
 VOID STDCALL
 HalInitializeProcessor(ULONG ProcessorNumber,
                       PVOID /*PLOADER_PARAMETER_BLOCK*/ LoaderBlock)
 {
-#ifdef MP
    ULONG CPU;
-#endif
 
    DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber, LoaderBlock);
 
-#ifdef MP
    CPU = ThisCPU();
    if (OnlineCPUs & (1 << CPU))
    {
@@ -1041,17 +1021,14 @@ HalInitializeProcessor(ULONG ProcessorNumber,
 
    /* Setup busy waiting */
    HalpCalibrateStallExecution();
-#endif
 }
 
 BOOLEAN STDCALL
 HalAllProcessorsStarted (VOID)
 {
-    DPRINT("HalAllProcessorsStarted()\n");
-
-#ifdef MP
-
     ULONG CPUs = 0, i;
+
+    DPRINT("HalAllProcessorsStarted()\n");
     for (i = 0; i < 32; i++)
     {
        if (OnlineCPUs & (1 << i))
@@ -1069,19 +1046,12 @@ HalAllProcessorsStarted (VOID)
        return TRUE;
     }
     return FALSE;
-
-#else /* MP */
-
-    return TRUE;
-
-#endif /* MP */
 }
 
 BOOLEAN STDCALL 
 HalStartNextProcessor(ULONG Unknown1,
                      ULONG ProcessorStack)
 {
-#ifdef MP
    PCOMMON_AREA_INFO Common;
    ULONG StartupCount;
    ULONG DeliveryStatus = 0;
@@ -1231,13 +1201,10 @@ HalStartNextProcessor(ULONG Unknown1,
    }
 #endif
 
-#endif /* MP */
    return TRUE;
 }
 
 
-#ifdef MP
-
 ULONG MPChecksum(PUCHAR Base,
                  ULONG Size)
 /*
@@ -1837,6 +1804,4 @@ HaliReconfigurePciInterrupts(VOID)
 
 }
 
-#endif /* MP */
-
 /* EOF */
diff --git a/reactos/hal/halx86/mp/resource_mp.c b/reactos/hal/halx86/mp/resource_mp.c
new file mode 100644 (file)
index 0000000..cce7ec1
--- /dev/null
@@ -0,0 +1,38 @@
+/* $Id: resource_mp.c,v 1.1 2004/12/03 20:10:44 gvg Exp $
+ *
+ * COPYRIGHT:             See COPYING in the top level directory
+ * PROJECT:               ReactOS kernel
+ * FILE:                  hal/halx86/mp/resource_mp.c
+ * PURPOSE:               Miscellaneous resource functions for MP
+ * PROGRAMMER:            Eric Kohl (ekohl@rz-online.de)
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+/* FUNCTIONS ****************************************************************/
+
+VOID
+HaliReconfigurePciInterrupts(VOID);
+
+
+VOID STDCALL
+HalReportResourceUsage(VOID)
+{
+  /*
+   * FIXME: Report all resources used by hal.
+   *        Calls IoReportHalResourceUsage()
+   */
+
+  /* Initialize PCI bus. */
+  HalpInitPciBus ();
+
+  HaliReconfigurePciInterrupts();
+}
+
+/* EOF */
diff --git a/reactos/hal/halx86/up/.cvsignore b/reactos/hal/halx86/up/.cvsignore
new file mode 100644 (file)
index 0000000..6e8d924
--- /dev/null
@@ -0,0 +1,7 @@
+*.d
+*.dll
+*.coff
+*.a
+*.o
+*.sym
+*.map
diff --git a/reactos/hal/halx86/up/Makefile b/reactos/hal/halx86/up/Makefile
new file mode 100644 (file)
index 0000000..dfff4ad
--- /dev/null
@@ -0,0 +1,89 @@
+# $Id: Makefile,v 1.1 2004/12/03 20:10:45 gvg Exp $
+
+PATH_TO_TOP = ../../..
+
+VPATH = ../generic
+
+default: all
+
+#
+# Build configuration
+#
+include $(PATH_TO_TOP)/rules.mak
+
+#
+# Global configuration
+#
+include $(TOOLS_PATH)/config.mk
+
+TARGET_BOOTSTRAP = yes
+
+TARGET_TYPE = hal
+
+TARGET_DEFNAME = ../../hal/hal
+
+TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ASM__ -DUP
+
+TARGET_CFLAGS = -I../include -I$(PATH_TO_TOP)/ntoskrnl/include -Wall -Werror -DUP
+
+# require os code to explicitly request A/W version of structs/functions
+TARGET_CFLAGS += -D_DISABLE_TIDENTS
+
+TARGET_NAME = halup
+
+ifeq ($(MP), 1)
+TARGET_INSTALL = no
+else
+TARGET_BOOTSTRAP = yes
+endif
+
+GENERIC_OBJECTS = \
+       adapter.o \
+       beep.o \
+       bus.o \
+       display.o \
+       dma.o \
+       drive.o \
+       enum.o \
+       fmutex.o \
+       halinit.o \
+       ipi.o \
+       irql.o \
+       isa.o \
+       kdbg.o \
+       mca.o \
+       misc.o \
+       pci.o \
+       portio.o \
+       processor.o \
+       reboot.o \
+       resource.o \
+       spinlock.o \
+       sysbus.o \
+       sysinfo.o \
+       time.o \
+       timer.o
+
+UP_OBJECTS = \
+       halinit_up.o
+
+HAL_OBJECTS = $(GENERIC_OBJECTS) $(UP_OBJECTS)
+
+DEP_OBJECTS := $(HAL_OBJECTS)
+
+TARGET_OBJECTS := $(DEP_OBJECTS) $(PATH_TO_TOP)/include/roscfg.h
+
+# Note: Must be = and not := since $(DEP_FILES) is assigned a value below
+TARGET_CLEAN = $(DEP_FILES) *.o *.dll
+
+#
+# Helper makefile
+#
+include $(TOOLS_PATH)/helper.mk
+
+#
+# Include automatic dependancy tracking
+#
+include $(TOOLS_PATH)/depend.mk
+
+# EOF
diff --git a/reactos/hal/halx86/up/halinit_up.c b/reactos/hal/halx86/up/halinit_up.c
new file mode 100644 (file)
index 0000000..3cf2ade
--- /dev/null
@@ -0,0 +1,31 @@
+/* $Id: halinit_up.c,v 1.1 2004/12/03 20:10:45 gvg Exp $
+ *
+ * COPYRIGHT:     See COPYING in the top level directory
+ * PROJECT:       ReactOS kernel
+ * FILE:          ntoskrnl/hal/x86/halinit.c
+ * PURPOSE:       Initalize the x86 hal
+ * PROGRAMMER:    David Welch (welch@cwcom.net)
+ * UPDATE HISTORY:
+ *              11/06/98: Created
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <ddk/ntddk.h>
+#include <hal.h>
+
+#define NDEBUG
+#include <internal/debug.h>
+
+/* FUNCTIONS ***************************************************************/
+
+VOID
+HalpInitPhase0(VOID)
+{
+  HalpInitPICs();
+
+  /* Setup busy waiting */
+  HalpCalibrateStallExecution();
+}
+
+/* EOF */
similarity index 58%
rename from reactos/hal/halx86/halx86up.rc
rename to reactos/hal/halx86/up/halup.rc
index 6fdd802..90af6b9 100644 (file)
@@ -1,5 +1,5 @@
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "X86 Uniprocessor Hardware Abstraction Layer\0"
-#define REACTOS_STR_INTERNAL_NAME      "halx86up\0"
-#define REACTOS_STR_ORIGINAL_FILENAME  "halx86up.dll\0"
+#define REACTOS_STR_INTERNAL_NAME      "halup\0"
+#define REACTOS_STR_ORIGINAL_FILENAME  "halup.dll\0"
 #include <reactos/version.rc>
index e3f3000..634d839 100644 (file)
@@ -111,7 +111,7 @@ VOID STDCALL KeEnterKernelDebugger (VOID);
 KIRQL STDCALL KeGetCurrentIrql (VOID);
 
 #ifndef __USE_W32API
-ULONG KeGetCurrentProcessorNumber(VOID);
+#define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber)
 ULONG KeGetDcacheFillSize(VOID);
 ULONG STDCALL KeGetPreviousMode (VOID);
 #endif
index 4828ae3..49b5293 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: helper.mk,v 1.95 2004/11/20 17:48:38 chorns Exp $
+# $Id: helper.mk,v 1.96 2004/12/03 20:10:45 gvg Exp $
 #
 # Helper makefile for ReactOS modules
 # Variables this makefile accepts:
@@ -51,6 +51,7 @@
 #   $TARGET_BOOTSTRAP  = Whether this file is needed to bootstrap the installation (no,yes) (optional)
 #   $TARGET_BOOTSTRAP_NAME = Name on the installation medium (optional)
 #   $TARGET_REGTESTS   = This module has regression tests (no,yes) (optional)
+#   $TARGET_INSTALL    = Install the file (no,yes) (optional)
 #   $SUBDIRS           = Subdirs in which to run make (optional)
 
 include $(PATH_TO_TOP)/config
@@ -276,6 +277,8 @@ ifeq ($(TARGET_TYPE),hal)
   MK_BOOTCDDIR := .
   MK_DISTDIR := dlls
   MK_RES_BASE := $(TARGET_NAME)
+  MK_INSTALL_BASENAME := hal
+  MK_INSTALL_FULLNAME := hal.dll
 endif
 
 ifeq ($(TARGET_TYPE),bootpgm)
@@ -374,7 +377,6 @@ ifeq ($(TARGET_TYPE),test)
   TARGET_OBJECTS := _rtstub.o _regtests.o $(TARGET_OBJECTS)
 endif
 
-
 # can be overidden with $(CXX) for linkage of c++ executables
 LD_CC = $(CC)
 
@@ -689,6 +691,19 @@ else
   MK_REGTESTS_CLEAN :=
 endif
 
+ifeq ($(TARGET_INSTALL),)
+ MK_INSTALL := yes
+else
+ MK_INSTALL := $(TARGET_INSTALL)
+endif
+
+ifeq ($(MK_INSTALL_BASENAME),)
+  MK_INSTALL_BASENAME := $(MK_BASENAME)
+endif
+ifeq ($(MK_INSTALL_FULLNAME),)
+  MK_INSTALL_FULLNAME := $(MK_FULLNAME)
+endif
+
 ifeq ($(MK_IMPLIBONLY),yes)
 
 TARGET_CLEAN += $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME)
@@ -963,6 +978,8 @@ ifeq ($(MK_IMPLIBONLY),yes)
 
 # Don't install import libraries
 
+forceinstall:
+
 install:
 
 bootcd:
@@ -973,23 +990,35 @@ else # MK_IMPLIBONLY
 # Don't install static libraries
 ifeq ($(MK_MODE),static)
 
+forceinstall:
+
 install:
        
 bootcd:        
 
 else # MK_MODE
 
+ifneq ($(MK_INSTALL),no)
+
+install: forceinstall
+
+else # MK_INSTALL
+
+install:
+
+endif # MK_INSTALL
+
 ifeq ($(INSTALL_SYMBOLS),yes)
 
-install: $(SUBDIRS:%=%_install) $(MK_FULLNAME) $(MK_BASENAME).sym
-       -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME)
-       -$(CP) $(MK_BASENAME).sym $(INSTALL_DIR)/symbols/$(MK_BASENAME).sym
+forceinstall: $(SUBDIRS:%=%_install) $(MK_FULLNAME) $(MK_BASENAME).sym
+       -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_INSTALL_FULLNAME)
+       -$(CP) $(MK_BASENAME).sym $(INSTALL_DIR)/symbols/$(MK_INSTALL_BASENAME).sym
        @echo $(MK_FULLNAME) was successfully installed.
 
 else # INSTALL_SYMBOLS
 
-install: $(SUBDIRS:%=%_install) $(MK_FULLNAME)
-       -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME)
+forceinstall: $(SUBDIRS:%=%_install) $(MK_FULLNAME)
+       -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_INSTALL_FULLNAME)
 
 endif # INSTALL_SYMBOLS
 
index 73806e0..3d8cf14 100644 (file)
@@ -102,11 +102,20 @@ main(int argc, char* argv[])
   include_tests = 0;
   for (i = 2; i < argc; i++)
     {
-         if (strcmp(argv[i], "REGTESTS") == 0)
+      if (strcmp(argv[i], "REGTESTS") == 0)
         {
           include_tests = 1;
         }
-      s = s + sprintf(s, "#define %s\n", argv[i]);
+      if (strcmp(argv[i], "MP") == 0 || strcmp(argv[i], "UP") == 0)
+        {
+          s = s + sprintf(s, "#if ! defined(MP) && ! defined(UP)\n");
+          s = s + sprintf(s, "#define %s\n", argv[i]);
+          s = s + sprintf(s, "#endif /* ! defined(MP) && ! defined(UP) */\n");
+        }
+      else
+        {
+          s = s + sprintf(s, "#define %s\n", argv[i]);
+        }
       strcat(config, argv[i]);
       if (i != (argc - 1))
        {