From 92ed2da0dae20704c7260a5a6b6e804aca865a3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=A9=20van=20Geldorp?= Date: Fri, 3 Dec 2004 20:10:45 +0000 Subject: [PATCH] Reorganise HAL so multiple HAL versions can be built in parallel svn path=/trunk/; revision=11909 --- reactos/Makefile | 4 +- reactos/hal/halx86/{ => generic}/adapter.c | 2 +- reactos/hal/halx86/{ => generic}/beep.c | 0 reactos/hal/halx86/{ => generic}/bus.c | 2 +- reactos/hal/halx86/{ => generic}/display.c | 2 +- reactos/hal/halx86/{ => generic}/dma.c | 2 +- reactos/hal/halx86/{ => generic}/drive.c | 2 +- reactos/hal/halx86/{ => generic}/enum.c | 3 +- reactos/hal/halx86/{ => generic}/fmutex.c | 2 +- reactos/hal/halx86/{ => generic}/halinit.c | 21 +---- reactos/hal/halx86/generic/ipi.c | 26 ++++++ reactos/hal/halx86/{ => generic}/irql.c | 3 +- reactos/hal/halx86/{ => generic}/isa.c | 3 +- reactos/hal/halx86/{ => generic}/kdbg.c | 2 +- reactos/hal/halx86/{ => generic}/mca.c | 2 +- reactos/hal/halx86/{ => generic}/misc.c | 42 +-------- reactos/hal/halx86/{ => generic}/pci.c | 3 +- reactos/hal/halx86/{ => generic}/portio.c | 2 +- reactos/hal/halx86/generic/processor.c | 50 +++++++++++ reactos/hal/halx86/{ => generic}/pwroff.c | 2 +- reactos/hal/halx86/{ => generic}/reboot.c | 2 +- reactos/hal/halx86/generic/resource.c | 32 +++++++ reactos/hal/halx86/{ => generic}/spinlock.c | 2 +- reactos/hal/halx86/{ => generic}/sysbus.c | 3 +- reactos/hal/halx86/{ => generic}/sysinfo.c | 0 reactos/hal/halx86/{ => generic}/time.c | 0 reactos/hal/halx86/{ => generic}/timer.c | 3 +- reactos/hal/halx86/include/hal.h | 3 + reactos/hal/halx86/{ => mp}/.cvsignore | 0 reactos/hal/halx86/{ => mp}/Makefile | 53 +++++------ reactos/hal/halx86/{ => mp}/apic.c | 4 +- reactos/hal/halx86/mp/halinit_mp.c | 29 ++++++ .../hal/halx86/{halx86mp.rc => mp/halmp.rc} | 0 reactos/hal/halx86/mp/ipi_mp.c | 29 ++++++ reactos/hal/halx86/{ => mp}/mps.S | 4 +- reactos/hal/halx86/{ => mp}/mpsboot.asm | 0 reactos/hal/halx86/{ => mp}/mpsirql.c | 1 - .../hal/halx86/{mp.c => mp/processor_mp.c} | 43 +-------- reactos/hal/halx86/mp/resource_mp.c | 38 ++++++++ reactos/hal/halx86/up/.cvsignore | 7 ++ reactos/hal/halx86/up/Makefile | 89 +++++++++++++++++++ reactos/hal/halx86/up/halinit_up.c | 31 +++++++ .../hal/halx86/{halx86up.rc => up/halup.rc} | 4 +- reactos/include/ddk/kefuncs.h | 2 +- reactos/tools/helper.mk | 43 +++++++-- reactos/tools/mkconfig.c | 13 ++- 46 files changed, 436 insertions(+), 174 deletions(-) rename reactos/hal/halx86/{ => generic}/adapter.c (99%) rename reactos/hal/halx86/{ => generic}/beep.c (100%) rename reactos/hal/halx86/{ => generic}/bus.c (99%) rename reactos/hal/halx86/{ => generic}/display.c (99%) rename reactos/hal/halx86/{ => generic}/dma.c (99%) rename reactos/hal/halx86/{ => generic}/drive.c (93%) rename reactos/hal/halx86/{ => generic}/enum.c (87%) rename reactos/hal/halx86/{ => generic}/fmutex.c (95%) rename reactos/hal/halx86/{ => generic}/halinit.c (83%) create mode 100644 reactos/hal/halx86/generic/ipi.c rename reactos/hal/halx86/{ => generic}/irql.c (99%) rename reactos/hal/halx86/{ => generic}/isa.c (95%) rename reactos/hal/halx86/{ => generic}/kdbg.c (99%) rename reactos/hal/halx86/{ => generic}/mca.c (97%) rename reactos/hal/halx86/{ => generic}/misc.c (67%) rename reactos/hal/halx86/{ => generic}/pci.c (99%) rename reactos/hal/halx86/{ => generic}/portio.c (99%) create mode 100644 reactos/hal/halx86/generic/processor.c rename reactos/hal/halx86/{ => generic}/pwroff.c (97%) rename reactos/hal/halx86/{ => generic}/reboot.c (96%) create mode 100644 reactos/hal/halx86/generic/resource.c rename reactos/hal/halx86/{ => generic}/spinlock.c (97%) rename reactos/hal/halx86/{ => generic}/sysbus.c (94%) rename reactos/hal/halx86/{ => generic}/sysinfo.c (100%) rename reactos/hal/halx86/{ => generic}/time.c (100%) rename reactos/hal/halx86/{ => generic}/timer.c (99%) rename reactos/hal/halx86/{ => mp}/.cvsignore (100%) rename reactos/hal/halx86/{ => mp}/Makefile (63%) rename reactos/hal/halx86/{ => mp}/apic.c (99%) create mode 100644 reactos/hal/halx86/mp/halinit_mp.c rename reactos/hal/halx86/{halx86mp.rc => mp/halmp.rc} (100%) create mode 100644 reactos/hal/halx86/mp/ipi_mp.c rename reactos/hal/halx86/{ => mp}/mps.S (96%) rename reactos/hal/halx86/{ => mp}/mpsboot.asm (100%) rename reactos/hal/halx86/{ => mp}/mpsirql.c (99%) rename reactos/hal/halx86/{mp.c => mp/processor_mp.c} (99%) create mode 100644 reactos/hal/halx86/mp/resource_mp.c create mode 100644 reactos/hal/halx86/up/.cvsignore create mode 100644 reactos/hal/halx86/up/Makefile create mode 100644 reactos/hal/halx86/up/halinit_up.c rename reactos/hal/halx86/{halx86up.rc => up/halup.rc} (58%) diff --git a/reactos/Makefile b/reactos/Makefile index 641d4ca723c..c53ed6de120 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -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 diff --git a/reactos/hal/halx86/adapter.c b/reactos/hal/halx86/generic/adapter.c similarity index 99% rename from reactos/hal/halx86/adapter.c rename to reactos/hal/halx86/generic/adapter.c index 1908758973b..8ad04433c26 100644 --- a/reactos/hal/halx86/adapter.c +++ b/reactos/hal/halx86/generic/adapter.c @@ -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 diff --git a/reactos/hal/halx86/beep.c b/reactos/hal/halx86/generic/beep.c similarity index 100% rename from reactos/hal/halx86/beep.c rename to reactos/hal/halx86/generic/beep.c diff --git a/reactos/hal/halx86/bus.c b/reactos/hal/halx86/generic/bus.c similarity index 99% rename from reactos/hal/halx86/bus.c rename to reactos/hal/halx86/generic/bus.c index d379db72cf9..bc6a4144cdb 100644 --- a/reactos/hal/halx86/bus.c +++ b/reactos/hal/halx86/generic/bus.c @@ -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 diff --git a/reactos/hal/halx86/display.c b/reactos/hal/halx86/generic/display.c similarity index 99% rename from reactos/hal/halx86/display.c rename to reactos/hal/halx86/generic/display.c index b23b4a0f5f6..66ed8a44ad0 100644 --- a/reactos/hal/halx86/display.c +++ b/reactos/hal/halx86/generic/display.c @@ -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 diff --git a/reactos/hal/halx86/dma.c b/reactos/hal/halx86/generic/dma.c similarity index 99% rename from reactos/hal/halx86/dma.c rename to reactos/hal/halx86/generic/dma.c index 5d010b8b9b5..c84921f7dd9 100644 --- a/reactos/hal/halx86/dma.c +++ b/reactos/hal/halx86/generic/dma.c @@ -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 diff --git a/reactos/hal/halx86/drive.c b/reactos/hal/halx86/generic/drive.c similarity index 93% rename from reactos/hal/halx86/drive.c rename to reactos/hal/halx86/generic/drive.c index 29f0a20edd3..edfe3d519f4 100644 --- a/reactos/hal/halx86/drive.c +++ b/reactos/hal/halx86/generic/drive.c @@ -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 diff --git a/reactos/hal/halx86/enum.c b/reactos/hal/halx86/generic/enum.c similarity index 87% rename from reactos/hal/halx86/enum.c rename to reactos/hal/halx86/generic/enum.c index c5147cd53f4..1855d5a919e 100644 --- a/reactos/hal/halx86/enum.c +++ b/reactos/hal/halx86/generic/enum.c @@ -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 -#include #define NDEBUG #include diff --git a/reactos/hal/halx86/fmutex.c b/reactos/hal/halx86/generic/fmutex.c similarity index 95% rename from reactos/hal/halx86/fmutex.c rename to reactos/hal/halx86/generic/fmutex.c index 9254dc86514..bc9c84d8a50 100644 --- a/reactos/hal/halx86/fmutex.c +++ b/reactos/hal/halx86/generic/fmutex.c @@ -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 diff --git a/reactos/hal/halx86/halinit.c b/reactos/hal/halx86/generic/halinit.c similarity index 83% rename from reactos/hal/halx86/halinit.c rename to reactos/hal/halx86/generic/halinit.c index f1e030e9262..5fab4d78322 100644 --- a/reactos/hal/halx86/halinit.c +++ b/reactos/hal/halx86/generic/halinit.c @@ -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 @@ -12,13 +12,8 @@ /* INCLUDES *****************************************************************/ #include -#include #include -#ifdef MP -#include -#endif /* MP */ - #define NDEBUG #include @@ -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 index 00000000000..9ec5a0e5ddc --- /dev/null +++ b/reactos/hal/halx86/generic/ipi.c @@ -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 +#include + +#define NDEBUG +#include + +/* FUNCTIONS ****************************************************************/ + +VOID STDCALL +HalRequestIpi(ULONG ProcessorNo) +{ + DPRINT("HalRequestIpi(ProcessorNo %d)\n", ProcessorNo); +} + +/* EOF */ diff --git a/reactos/hal/halx86/irql.c b/reactos/hal/halx86/generic/irql.c similarity index 99% rename from reactos/hal/halx86/irql.c rename to reactos/hal/halx86/generic/irql.c index 3a39a3322db..10264ac43fd 100644 --- a/reactos/hal/halx86/irql.c +++ b/reactos/hal/halx86/generic/irql.c @@ -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 #include #include #include diff --git a/reactos/hal/halx86/isa.c b/reactos/hal/halx86/generic/isa.c similarity index 95% rename from reactos/hal/halx86/isa.c rename to reactos/hal/halx86/generic/isa.c index a694ccf8da2..81f4e56d425 100644 --- a/reactos/hal/halx86/isa.c +++ b/reactos/hal/halx86/generic/isa.c @@ -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 #include #include #include diff --git a/reactos/hal/halx86/kdbg.c b/reactos/hal/halx86/generic/kdbg.c similarity index 99% rename from reactos/hal/halx86/kdbg.c rename to reactos/hal/halx86/generic/kdbg.c index 6e55bc2cec9..93b10fa6084 100644 --- a/reactos/hal/halx86/kdbg.c +++ b/reactos/hal/halx86/generic/kdbg.c @@ -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 diff --git a/reactos/hal/halx86/mca.c b/reactos/hal/halx86/generic/mca.c similarity index 97% rename from reactos/hal/halx86/mca.c rename to reactos/hal/halx86/generic/mca.c index dc09835e804..9aa7c6840c1 100644 --- a/reactos/hal/halx86/mca.c +++ b/reactos/hal/halx86/generic/mca.c @@ -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 diff --git a/reactos/hal/halx86/misc.c b/reactos/hal/halx86/generic/misc.c similarity index 67% rename from reactos/hal/halx86/misc.c rename to reactos/hal/halx86/generic/misc.c index 4339d8081b1..a94d747d47a 100644 --- a/reactos/hal/halx86/misc.c +++ b/reactos/hal/halx86/generic/misc.c @@ -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 #include #include -#ifdef MP -#include -#endif - #define NDEBUG #include /* 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 */ diff --git a/reactos/hal/halx86/pci.c b/reactos/hal/halx86/generic/pci.c similarity index 99% rename from reactos/hal/halx86/pci.c rename to reactos/hal/halx86/generic/pci.c index 46770af07e9..79d58aa562f 100644 --- a/reactos/hal/halx86/pci.c +++ b/reactos/hal/halx86/generic/pci.c @@ -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 #include #include #include diff --git a/reactos/hal/halx86/portio.c b/reactos/hal/halx86/generic/portio.c similarity index 99% rename from reactos/hal/halx86/portio.c rename to reactos/hal/halx86/generic/portio.c index a308efe577a..63e1cac60e6 100644 --- a/reactos/hal/halx86/portio.c +++ b/reactos/hal/halx86/generic/portio.c @@ -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 index 00000000000..36b151ac82a --- /dev/null +++ b/reactos/hal/halx86/generic/processor.c @@ -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 +#include + +#define NDEBUG +#include + + +/* 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 */ diff --git a/reactos/hal/halx86/pwroff.c b/reactos/hal/halx86/generic/pwroff.c similarity index 97% rename from reactos/hal/halx86/pwroff.c rename to reactos/hal/halx86/generic/pwroff.c index 89ddf792a4c..a962d7ba496 100644 --- a/reactos/hal/halx86/pwroff.c +++ b/reactos/hal/halx86/generic/pwroff.c @@ -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... diff --git a/reactos/hal/halx86/reboot.c b/reactos/hal/halx86/generic/reboot.c similarity index 96% rename from reactos/hal/halx86/reboot.c rename to reactos/hal/halx86/generic/reboot.c index 76f444ceb7d..cdd650183c1 100644 --- a/reactos/hal/halx86/reboot.c +++ b/reactos/hal/halx86/generic/reboot.c @@ -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 index 00000000000..a2cfd3beeee --- /dev/null +++ b/reactos/hal/halx86/generic/resource.c @@ -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 +#include + +#define NDEBUG +#include + +/* FUNCTIONS ****************************************************************/ + +VOID STDCALL +HalReportResourceUsage(VOID) +{ + /* + * FIXME: Report all resources used by hal. + * Calls IoReportHalResourceUsage() + */ + + /* Initialize PCI bus. */ + HalpInitPciBus (); +} + +/* EOF */ diff --git a/reactos/hal/halx86/spinlock.c b/reactos/hal/halx86/generic/spinlock.c similarity index 97% rename from reactos/hal/halx86/spinlock.c rename to reactos/hal/halx86/generic/spinlock.c index d4f4cbf37d8..144344c0ad4 100644 --- a/reactos/hal/halx86/spinlock.c +++ b/reactos/hal/halx86/generic/spinlock.c @@ -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 diff --git a/reactos/hal/halx86/sysbus.c b/reactos/hal/halx86/generic/sysbus.c similarity index 94% rename from reactos/hal/halx86/sysbus.c rename to reactos/hal/halx86/generic/sysbus.c index ca5e916806d..cb292247905 100644 --- a/reactos/hal/halx86/sysbus.c +++ b/reactos/hal/halx86/generic/sysbus.c @@ -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 #include #include #include diff --git a/reactos/hal/halx86/sysinfo.c b/reactos/hal/halx86/generic/sysinfo.c similarity index 100% rename from reactos/hal/halx86/sysinfo.c rename to reactos/hal/halx86/generic/sysinfo.c diff --git a/reactos/hal/halx86/time.c b/reactos/hal/halx86/generic/time.c similarity index 100% rename from reactos/hal/halx86/time.c rename to reactos/hal/halx86/generic/time.c diff --git a/reactos/hal/halx86/timer.c b/reactos/hal/halx86/generic/timer.c similarity index 99% rename from reactos/hal/halx86/timer.c rename to reactos/hal/halx86/generic/timer.c index 70a3e4f6d66..57e54c5599e 100644 --- a/reactos/hal/halx86/timer.c +++ b/reactos/hal/halx86/generic/timer.c @@ -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 #include #include #include diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h index 863594591b9..88d382ecd8c 100644 --- a/reactos/hal/halx86/include/hal.h +++ b/reactos/hal/halx86/include/hal.h @@ -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) diff --git a/reactos/hal/halx86/.cvsignore b/reactos/hal/halx86/mp/.cvsignore similarity index 100% rename from reactos/hal/halx86/.cvsignore rename to reactos/hal/halx86/mp/.cvsignore diff --git a/reactos/hal/halx86/Makefile b/reactos/hal/halx86/mp/Makefile similarity index 63% rename from reactos/hal/halx86/Makefile rename to reactos/hal/halx86/mp/Makefile index 6727304871b..65f85f5299a 100644 --- a/reactos/hal/halx86/Makefile +++ b/reactos/hal/halx86/mp/Makefile @@ -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 diff --git a/reactos/hal/halx86/apic.c b/reactos/hal/halx86/mp/apic.c similarity index 99% rename from reactos/hal/halx86/apic.c rename to reactos/hal/halx86/mp/apic.c index b045eb60292..91bc774ff96 100644 --- a/reactos/hal/halx86/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -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 #include +#include #include #include diff --git a/reactos/hal/halx86/mp/halinit_mp.c b/reactos/hal/halx86/mp/halinit_mp.c new file mode 100644 index 00000000000..57c00652446 --- /dev/null +++ b/reactos/hal/halx86/mp/halinit_mp.c @@ -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 +#include +#include + +#define NDEBUG +#include + +/* FUNCTIONS ***************************************************************/ + +VOID +HalpInitPhase0(VOID) +{ + HalpInitMPS(); +} + +/* EOF */ diff --git a/reactos/hal/halx86/halx86mp.rc b/reactos/hal/halx86/mp/halmp.rc similarity index 100% rename from reactos/hal/halx86/halx86mp.rc rename to reactos/hal/halx86/mp/halmp.rc diff --git a/reactos/hal/halx86/mp/ipi_mp.c b/reactos/hal/halx86/mp/ipi_mp.c new file mode 100644 index 00000000000..bbeab8d49b1 --- /dev/null +++ b/reactos/hal/halx86/mp/ipi_mp.c @@ -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 +#include +#include + +#define NDEBUG +#include + +/* 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 */ diff --git a/reactos/hal/halx86/mps.S b/reactos/hal/halx86/mp/mps.S similarity index 96% rename from reactos/hal/halx86/mps.S rename to reactos/hal/halx86/mp/mps.S index 9ab3796ad72..25f144b2d48 100644 --- a/reactos/hal/halx86/mps.S +++ b/reactos/hal/halx86/mp/mps.S @@ -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; \ diff --git a/reactos/hal/halx86/mpsboot.asm b/reactos/hal/halx86/mp/mpsboot.asm similarity index 100% rename from reactos/hal/halx86/mpsboot.asm rename to reactos/hal/halx86/mp/mpsboot.asm diff --git a/reactos/hal/halx86/mpsirql.c b/reactos/hal/halx86/mp/mpsirql.c similarity index 99% rename from reactos/hal/halx86/mpsirql.c rename to reactos/hal/halx86/mp/mpsirql.c index 45bc850b321..6ed7f052bc2 100644 --- a/reactos/hal/halx86/mpsirql.c +++ b/reactos/hal/halx86/mp/mpsirql.c @@ -11,7 +11,6 @@ /* INCLUDES *****************************************************************/ -#include #include #include #include diff --git a/reactos/hal/halx86/mp.c b/reactos/hal/halx86/mp/processor_mp.c similarity index 99% rename from reactos/hal/halx86/mp.c rename to reactos/hal/halx86/mp/processor_mp.c index 8c1add04ea3..0b11e737f3e 100644 --- a/reactos/hal/halx86/mp.c +++ b/reactos/hal/halx86/mp/processor_mp.c @@ -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) @@ -14,12 +14,7 @@ /* INCLUDES *****************************************************************/ -#include #include - - -#ifdef MP - #include #include #include @@ -30,14 +25,9 @@ #include #include -#endif - #define NDEBUG #include -#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 index 00000000000..cce7ec10f07 --- /dev/null +++ b/reactos/hal/halx86/mp/resource_mp.c @@ -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 +#include + +#define NDEBUG +#include + +/* 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 index 00000000000..6e8d92447c5 --- /dev/null +++ b/reactos/hal/halx86/up/.cvsignore @@ -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 index 00000000000..dfff4ad8420 --- /dev/null +++ b/reactos/hal/halx86/up/Makefile @@ -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 index 00000000000..3cf2adeaafe --- /dev/null +++ b/reactos/hal/halx86/up/halinit_up.c @@ -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 +#include + +#define NDEBUG +#include + +/* FUNCTIONS ***************************************************************/ + +VOID +HalpInitPhase0(VOID) +{ + HalpInitPICs(); + + /* Setup busy waiting */ + HalpCalibrateStallExecution(); +} + +/* EOF */ diff --git a/reactos/hal/halx86/halx86up.rc b/reactos/hal/halx86/up/halup.rc similarity index 58% rename from reactos/hal/halx86/halx86up.rc rename to reactos/hal/halx86/up/halup.rc index 6fdd802c4fa..90af6b929ff 100644 --- a/reactos/hal/halx86/halx86up.rc +++ b/reactos/hal/halx86/up/halup.rc @@ -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 diff --git a/reactos/include/ddk/kefuncs.h b/reactos/include/ddk/kefuncs.h index e3f30005eaa..634d8394973 100644 --- a/reactos/include/ddk/kefuncs.h +++ b/reactos/include/ddk/kefuncs.h @@ -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 diff --git a/reactos/tools/helper.mk b/reactos/tools/helper.mk index 4828ae31fc4..49b5293b632 100644 --- a/reactos/tools/helper.mk +++ b/reactos/tools/helper.mk @@ -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 diff --git a/reactos/tools/mkconfig.c b/reactos/tools/mkconfig.c index 73806e0c404..3d8cf14dd8c 100644 --- a/reactos/tools/mkconfig.c +++ b/reactos/tools/mkconfig.c @@ -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)) { -- 2.17.1