Reorganise HAL so multiple HAL versions can be built in parallel

svn path=/trunk/; revision=11909
This commit is contained in:
Gé van Geldorp 2004-12-03 20:10:45 +00:00
parent bd2288fed5
commit 92ed2da0da
46 changed files with 436 additions and 174 deletions

View 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 # Global makefile
# #
@ -27,7 +27,7 @@ COMPONENTS = ntoskrnl
# Hardware Abstraction Layers # Hardware Abstraction Layers
# halx86 # halx86
HALS = halx86 HALS = halx86/up halx86/mp
# Bus drivers # Bus drivers
# acpi isapnp pci # acpi isapnp pci

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -12,7 +12,6 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <roscfg.h>
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -12,13 +12,8 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <roscfg.h>
#include <hal.h> #include <hal.h>
#ifdef MP
#include <mps.h>
#endif /* MP */
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
@ -46,19 +41,7 @@ HalInitSystem (ULONG BootPhase,
/* Initialize display and make the screen black */ /* Initialize display and make the screen black */
HalInitializeDisplay (LoaderBlock); HalInitializeDisplay (LoaderBlock);
#ifdef MP HalpInitPhase0();
HalpInitMPS();
#else
HalpInitPICs();
/* Setup busy waiting */
HalpCalibrateStallExecution();
#endif /* MP */
} }
else if (BootPhase == 1) else if (BootPhase == 1)
{ {

View file

@ -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 */

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -9,7 +9,6 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <internal/ps.h> #include <internal/ps.h>
#include <ntos/minmax.h> #include <ntos/minmax.h>

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -11,7 +11,6 @@
/* INCLUDES ***************************************************************/ /* INCLUDES ***************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <bus.h> #include <bus.h>
#include <halirq.h> #include <halirq.h>

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -9,26 +9,14 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <hal.h> #include <hal.h>
#ifdef MP
#include <apic.h>
#endif
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
#ifdef MP
VOID
HaliReconfigurePciInterrupts(VOID);
#endif
VOID STDCALL VOID STDCALL
HalHandleNMI(ULONG Unused) HalHandleNMI(ULONG Unused)
{ {
@ -61,16 +49,6 @@ HalProcessorIdle(VOID)
#endif #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 ULONG FASTCALL
HalSystemVectorDispatchEntry ( HalSystemVectorDispatchEntry (
ULONG Unknown1, ULONG Unknown1,
@ -88,22 +66,4 @@ KeFlushWriteBuffer(VOID)
return; return;
} }
VOID STDCALL
HalReportResourceUsage(VOID)
{
/*
* FIXME: Report all resources used by hal.
* Calls IoReportHalResourceUsage()
*/
/* Initialize PCI bus. */
HalpInitPciBus ();
#ifdef MP
HaliReconfigurePciInterrupts();
#endif
}
/* EOF */ /* EOF */

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -18,7 +18,6 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <bus.h> #include <bus.h>
#include <halirq.h> #include <halirq.h>

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -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 */

View 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 * FILE : reactos/hal/x86/apm.c
* DESCRIPTION: Turn CPU off... * DESCRIPTION: Turn CPU off...

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -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 */

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -11,7 +11,6 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <bus.h> #include <bus.h>
#include <halirq.h> #include <halirq.h>

View file

@ -20,7 +20,7 @@
* MA 02139, USA. * 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 * PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/x86/udelay.c * FILE: ntoskrnl/hal/x86/udelay.c
@ -32,7 +32,6 @@
/* INCLUDES ***************************************************************/ /* INCLUDES ***************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <internal/ps.h> #include <internal/ps.h>
#include <hal.h> #include <hal.h>

View file

@ -33,6 +33,9 @@ VOID HalpStartEnumerator (VOID);
/* dma.c */ /* dma.c */
VOID HalpInitDma (VOID); VOID HalpInitDma (VOID);
/* Non-generic initialization */
VOID HalpInitPhase0 (VOID);
/* DMA Page Register Structure /* DMA Page Register Structure
080 DMA RESERVED 080 DMA RESERVED
081 DMA Page Register (channel 2) 081 DMA Page Register (channel 2)

View 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 default: all
@ -14,33 +16,26 @@ include $(PATH_TO_TOP)/rules.mak
# #
include $(TOOLS_PATH)/config.mk include $(TOOLS_PATH)/config.mk
TARGET_BOOTSTRAP = yes
TARGET_TYPE = hal 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 -DMP
TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/ntoskrnl/include -Wall -Werror
# require os code to explicitly request A/W version of structs/functions # require os code to explicitly request A/W version of structs/functions
TARGET_CFLAGS += -D_DISABLE_TIDENTS TARGET_CFLAGS += -D_DISABLE_TIDENTS
TARGET_NAME = halmp
TARGET_NAME_UP = halx86up ifneq ($(MP), 1)
TARGET_INSTALL = no
TARGET_NAME_MP = halx86mp
ifeq ($(MP), 1)
TARGET_NAME = $(TARGET_NAME_MP)
else else
TARGET_NAME = $(TARGET_NAME_UP) TARGET_BOOTSTRAP = yes
endif endif
HAL_OBJECTS = \ GENERIC_OBJECTS = \
adapter.o \ adapter.o \
beep.o \ beep.o \
bus.o \ bus.o \
@ -54,7 +49,6 @@ HAL_OBJECTS = \
kdbg.o \ kdbg.o \
mca.o \ mca.o \
misc.o \ misc.o \
mp.o \
pci.o \ pci.o \
portio.o \ portio.o \
reboot.o \ reboot.o \
@ -64,24 +58,19 @@ HAL_OBJECTS = \
time.o \ time.o \
timer.o timer.o
#pwroff.o MP_OBJECTS = \
HAL_UP = \
$(HAL_OBJECTS) \
irql.o
HAL_MP = \
$(HAL_OBJECTS) \
apic.o \ apic.o \
halinit_mp.o \
ipi_mp.o \
mpsirql.o \ mpsirql.o \
mpsboot.o \ mpsboot.o \
mps.o mps.o \
processor_mp.o \
resource_mp.o
ifeq ($(MP), 1) HAL_OBJECTS = $(GENERIC_OBJECTS) $(MP_OBJECTS)
DEP_OBJECTS := $(HAL_MP)
else DEP_OBJECTS := $(HAL_OBJECTS)
DEP_OBJECTS := $(HAL_UP)
endif
TARGET_OBJECTS := $(DEP_OBJECTS) $(PATH_TO_TOP)/include/roscfg.h TARGET_OBJECTS := $(DEP_OBJECTS) $(PATH_TO_TOP)/include/roscfg.h

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -25,8 +25,8 @@
* PROGRAMMER: * PROGRAMMER:
*/ */
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <internal/i386/ps.h>
#include <hal.h> #include <hal.h>
#include <halirq.h> #include <halirq.h>

View file

@ -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 */

View file

@ -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 */

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -11,7 +11,6 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <internal/ke.h> #include <internal/ke.h>
#include <internal/ps.h> #include <internal/ps.h>

View 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/x86/mp.c * FILE: hal/halx86/mp/processor_mp.c
* PURPOSE: Intel MultiProcessor specification support * PURPOSE: Intel MultiProcessor specification support
* PROGRAMMER: David Welch (welch@cwcom.net) * PROGRAMMER: David Welch (welch@cwcom.net)
* Casper S. Hornstrup (chorns@users.sourceforge.net) * Casper S. Hornstrup (chorns@users.sourceforge.net)
@ -14,12 +14,7 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <roscfg.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#ifdef MP
#include <hal.h> #include <hal.h>
#include <halirq.h> #include <halirq.h>
#include <mps.h> #include <mps.h>
@ -30,14 +25,9 @@
#include <internal/ke.h> #include <internal/ke.h>
#include <internal/ps.h> #include <internal/ps.h>
#endif
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
#ifdef MP
/* /*
Address of area to be used for communication between Application Address of area to be used for communication between Application
Processors (APs) and the BootStrap Processor (BSP) Processors (APs) and the BootStrap Processor (BSP)
@ -91,14 +81,9 @@ extern VOID MpsIpiInterrupt(VOID);
WRITE_PORT_UCHAR((PUCHAR)0x71, value); \ WRITE_PORT_UCHAR((PUCHAR)0x71, value); \
}) })
#endif /* MP */
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
#ifdef MP
/* Functions for handling 8259A PICs */ /* Functions for handling 8259A PICs */
VOID Disable8259AIrq(ULONG irq) VOID Disable8259AIrq(ULONG irq)
@ -1003,19 +988,14 @@ SetInterruptGate(ULONG index, ULONG address)
idt->b = 0x8e00 + (((ULONG)address)&0xffff0000); idt->b = 0x8e00 + (((ULONG)address)&0xffff0000);
} }
#endif /* MP */
VOID STDCALL VOID STDCALL
HalInitializeProcessor(ULONG ProcessorNumber, HalInitializeProcessor(ULONG ProcessorNumber,
PVOID /*PLOADER_PARAMETER_BLOCK*/ LoaderBlock) PVOID /*PLOADER_PARAMETER_BLOCK*/ LoaderBlock)
{ {
#ifdef MP
ULONG CPU; ULONG CPU;
#endif
DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber, LoaderBlock); DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber, LoaderBlock);
#ifdef MP
CPU = ThisCPU(); CPU = ThisCPU();
if (OnlineCPUs & (1 << CPU)) if (OnlineCPUs & (1 << CPU))
{ {
@ -1041,17 +1021,14 @@ HalInitializeProcessor(ULONG ProcessorNumber,
/* Setup busy waiting */ /* Setup busy waiting */
HalpCalibrateStallExecution(); HalpCalibrateStallExecution();
#endif
} }
BOOLEAN STDCALL BOOLEAN STDCALL
HalAllProcessorsStarted (VOID) HalAllProcessorsStarted (VOID)
{ {
DPRINT("HalAllProcessorsStarted()\n");
#ifdef MP
ULONG CPUs = 0, i; ULONG CPUs = 0, i;
DPRINT("HalAllProcessorsStarted()\n");
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
{ {
if (OnlineCPUs & (1 << i)) if (OnlineCPUs & (1 << i))
@ -1069,19 +1046,12 @@ HalAllProcessorsStarted (VOID)
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
#else /* MP */
return TRUE;
#endif /* MP */
} }
BOOLEAN STDCALL BOOLEAN STDCALL
HalStartNextProcessor(ULONG Unknown1, HalStartNextProcessor(ULONG Unknown1,
ULONG ProcessorStack) ULONG ProcessorStack)
{ {
#ifdef MP
PCOMMON_AREA_INFO Common; PCOMMON_AREA_INFO Common;
ULONG StartupCount; ULONG StartupCount;
ULONG DeliveryStatus = 0; ULONG DeliveryStatus = 0;
@ -1231,13 +1201,10 @@ HalStartNextProcessor(ULONG Unknown1,
} }
#endif #endif
#endif /* MP */
return TRUE; return TRUE;
} }
#ifdef MP
ULONG MPChecksum(PUCHAR Base, ULONG MPChecksum(PUCHAR Base,
ULONG Size) ULONG Size)
/* /*
@ -1837,6 +1804,4 @@ HaliReconfigurePciInterrupts(VOID)
} }
#endif /* MP */
/* EOF */ /* EOF */

View file

@ -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 */

View file

@ -0,0 +1,7 @@
*.d
*.dll
*.coff
*.a
*.o
*.sym
*.map

View file

@ -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

View file

@ -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 */

View file

@ -1,5 +1,5 @@
#define REACTOS_VERSION_DLL #define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "X86 Uniprocessor Hardware Abstraction Layer\0" #define REACTOS_STR_FILE_DESCRIPTION "X86 Uniprocessor Hardware Abstraction Layer\0"
#define REACTOS_STR_INTERNAL_NAME "halx86up\0" #define REACTOS_STR_INTERNAL_NAME "halup\0"
#define REACTOS_STR_ORIGINAL_FILENAME "halx86up.dll\0" #define REACTOS_STR_ORIGINAL_FILENAME "halup.dll\0"
#include <reactos/version.rc> #include <reactos/version.rc>

View file

@ -111,7 +111,7 @@ VOID STDCALL KeEnterKernelDebugger (VOID);
KIRQL STDCALL KeGetCurrentIrql (VOID); KIRQL STDCALL KeGetCurrentIrql (VOID);
#ifndef __USE_W32API #ifndef __USE_W32API
ULONG KeGetCurrentProcessorNumber(VOID); #define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber)
ULONG KeGetDcacheFillSize(VOID); ULONG KeGetDcacheFillSize(VOID);
ULONG STDCALL KeGetPreviousMode (VOID); ULONG STDCALL KeGetPreviousMode (VOID);
#endif #endif

View 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 # Helper makefile for ReactOS modules
# Variables this makefile accepts: # Variables this makefile accepts:
@ -51,6 +51,7 @@
# $TARGET_BOOTSTRAP = Whether this file is needed to bootstrap the installation (no,yes) (optional) # $TARGET_BOOTSTRAP = Whether this file is needed to bootstrap the installation (no,yes) (optional)
# $TARGET_BOOTSTRAP_NAME = Name on the installation medium (optional) # $TARGET_BOOTSTRAP_NAME = Name on the installation medium (optional)
# $TARGET_REGTESTS = This module has regression tests (no,yes) (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) # $SUBDIRS = Subdirs in which to run make (optional)
include $(PATH_TO_TOP)/config include $(PATH_TO_TOP)/config
@ -276,6 +277,8 @@ ifeq ($(TARGET_TYPE),hal)
MK_BOOTCDDIR := . MK_BOOTCDDIR := .
MK_DISTDIR := dlls MK_DISTDIR := dlls
MK_RES_BASE := $(TARGET_NAME) MK_RES_BASE := $(TARGET_NAME)
MK_INSTALL_BASENAME := hal
MK_INSTALL_FULLNAME := hal.dll
endif endif
ifeq ($(TARGET_TYPE),bootpgm) ifeq ($(TARGET_TYPE),bootpgm)
@ -374,7 +377,6 @@ ifeq ($(TARGET_TYPE),test)
TARGET_OBJECTS := _rtstub.o _regtests.o $(TARGET_OBJECTS) TARGET_OBJECTS := _rtstub.o _regtests.o $(TARGET_OBJECTS)
endif endif
# can be overidden with $(CXX) for linkage of c++ executables # can be overidden with $(CXX) for linkage of c++ executables
LD_CC = $(CC) LD_CC = $(CC)
@ -689,6 +691,19 @@ else
MK_REGTESTS_CLEAN := MK_REGTESTS_CLEAN :=
endif 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) ifeq ($(MK_IMPLIBONLY),yes)
TARGET_CLEAN += $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME) TARGET_CLEAN += $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME)
@ -963,6 +978,8 @@ ifeq ($(MK_IMPLIBONLY),yes)
# Don't install import libraries # Don't install import libraries
forceinstall:
install: install:
bootcd: bootcd:
@ -973,23 +990,35 @@ else # MK_IMPLIBONLY
# Don't install static libraries # Don't install static libraries
ifeq ($(MK_MODE),static) ifeq ($(MK_MODE),static)
forceinstall:
install: install:
bootcd: bootcd:
else # MK_MODE else # MK_MODE
ifneq ($(MK_INSTALL),no)
install: forceinstall
else # MK_INSTALL
install:
endif # MK_INSTALL
ifeq ($(INSTALL_SYMBOLS),yes) ifeq ($(INSTALL_SYMBOLS),yes)
install: $(SUBDIRS:%=%_install) $(MK_FULLNAME) $(MK_BASENAME).sym forceinstall: $(SUBDIRS:%=%_install) $(MK_FULLNAME) $(MK_BASENAME).sym
-$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME) -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_INSTALL_FULLNAME)
-$(CP) $(MK_BASENAME).sym $(INSTALL_DIR)/symbols/$(MK_BASENAME).sym -$(CP) $(MK_BASENAME).sym $(INSTALL_DIR)/symbols/$(MK_INSTALL_BASENAME).sym
@echo $(MK_FULLNAME) was successfully installed. @echo $(MK_FULLNAME) was successfully installed.
else # INSTALL_SYMBOLS else # INSTALL_SYMBOLS
install: $(SUBDIRS:%=%_install) $(MK_FULLNAME) forceinstall: $(SUBDIRS:%=%_install) $(MK_FULLNAME)
-$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME) -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_INSTALL_FULLNAME)
endif # INSTALL_SYMBOLS endif # INSTALL_SYMBOLS

View file

@ -106,7 +106,16 @@ main(int argc, char* argv[])
{ {
include_tests = 1; include_tests = 1;
} }
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, "#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]); strcat(config, argv[i]);
if (i != (argc - 1)) if (i != (argc - 1))
{ {