From f8d9c5d204730517a7d4ffd7f36df773fca85d2f Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 5 Jan 2005 19:25:49 +0000 Subject: [PATCH] - Replaced MP with CONFIG_SMP. svn path=/trunk/; revision=12832 --- reactos/config | 2 +- reactos/hal/halx86/include/halirq.h | 4 +-- reactos/hal/halx86/mp/Makefile | 8 +++--- reactos/hal/halx86/up/Makefile | 8 +++--- reactos/ntoskrnl/ex/i386/interlck.c | 4 +-- reactos/ntoskrnl/include/internal/debug.h | 7 ++++- reactos/ntoskrnl/include/internal/i386/ke.h | 2 +- reactos/ntoskrnl/include/internal/i386/ps.h | 2 +- reactos/ntoskrnl/ke/dpc.c | 20 +++++++------- reactos/ntoskrnl/ke/i386/fpu.c | 14 +++++----- reactos/ntoskrnl/ke/i386/irq.c | 12 ++++----- reactos/ntoskrnl/ke/i386/multiboot.S | 30 ++++++++++----------- reactos/ntoskrnl/ke/i386/tskswitch.S | 8 +++--- reactos/ntoskrnl/ke/kthread.c | 4 +-- reactos/ntoskrnl/ke/spinlock.c | 19 ++++++++++--- reactos/ntoskrnl/mm/mminit.c | 8 +++--- reactos/tools/config.mk | 6 ++--- reactos/tools/mkconfig.c | 6 ----- 18 files changed, 86 insertions(+), 78 deletions(-) diff --git a/reactos/config b/reactos/config index 84bd534d112..8115d3ad193 100644 --- a/reactos/config +++ b/reactos/config @@ -35,7 +35,7 @@ OPTIMIZED := 0 # # Whether to compile a multiprocessor or single processor version # -MP := 0 +CONFIG_SMP := 0 # # Whether to compile for ACPI compliant systems diff --git a/reactos/hal/halx86/include/halirq.h b/reactos/hal/halx86/include/halirq.h index 9830a82b6e1..aa8e8ae5d5d 100644 --- a/reactos/hal/halx86/include/halirq.h +++ b/reactos/hal/halx86/include/halirq.h @@ -1,11 +1,11 @@ /* - * $Id: halirq.h,v 1.1 2004/11/01 14:37:18 hbirr Exp $ + * $Id$ */ #ifndef __INCLUDE_HAL_HALIRQ #define __INCLUDE_HAL_HALIRQ -#ifdef MP +#ifdef CONFIG_SMP #define FIRST_DEVICE_VECTOR (0x30) #define FIRST_SYSTEM_VECTOR (0xef) diff --git a/reactos/hal/halx86/mp/Makefile b/reactos/hal/halx86/mp/Makefile index f16085dc8ce..837237dfa0a 100644 --- a/reactos/hal/halx86/mp/Makefile +++ b/reactos/hal/halx86/mp/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2004/12/13 02:20:09 blight Exp $ +# $Id$ PATH_TO_TOP = ../../.. @@ -22,14 +22,14 @@ TARGET_TYPE = 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__ -DCONFIG_SMP -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 -DCONFIG_SMP # require os code to explicitly request A/W version of structs/functions TARGET_CFLAGS += -D_DISABLE_TIDENTS -ifneq ($(MP), 1) +ifneq ($(CONFIG_SMP), 1) TARGET_INSTALL = no else TARGET_BOOTSTRAP = yes diff --git a/reactos/hal/halx86/up/Makefile b/reactos/hal/halx86/up/Makefile index e28461d8c08..779f90643c5 100644 --- a/reactos/hal/halx86/up/Makefile +++ b/reactos/hal/halx86/up/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2004/12/13 02:20:09 blight Exp $ +# $Id$ PATH_TO_TOP = ../../.. @@ -24,14 +24,14 @@ TARGET_TYPE = hal TARGET_DEFNAME = ../../hal/hal -TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ASM__ -DUP +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 -DUP +TARGET_CFLAGS = -I../include -I$(PATH_TO_TOP)/ntoskrnl/include -Wall -Werror # require os code to explicitly request A/W version of structs/functions TARGET_CFLAGS += -D_DISABLE_TIDENTS -ifeq ($(MP), 1) +ifeq ($(CONFIG_SMP), 1) TARGET_INSTALL = no else TARGET_BOOTSTRAP = yes diff --git a/reactos/ntoskrnl/ex/i386/interlck.c b/reactos/ntoskrnl/ex/i386/interlck.c index c7d98af1d85..2c031db2779 100644 --- a/reactos/ntoskrnl/ex/i386/interlck.c +++ b/reactos/ntoskrnl/ex/i386/interlck.c @@ -11,7 +11,7 @@ #if defined(__GNUC__) -#ifdef MP +#ifdef CONFIG_SMP #define LOCK "lock ; " #else #define LOCK "" @@ -19,7 +19,7 @@ #elif defined(_MSC_VER) -#ifdef MP +#ifdef CONFIG_SMP #define LOCK lock #else #define LOCK diff --git a/reactos/ntoskrnl/include/internal/debug.h b/reactos/ntoskrnl/include/internal/debug.h index 4e0df358ee1..ce8c2f5d18e 100644 --- a/reactos/ntoskrnl/include/internal/debug.h +++ b/reactos/ntoskrnl/include/internal/debug.h @@ -20,7 +20,7 @@ #include #include -#include + #if defined(_MSC_VER) && (_MSC_VER < 1300) /* TODO: Verify which version the MS compiler learned the __FUNCTION__ macro */ @@ -37,8 +37,13 @@ /* Assert only on "checked" version */ #ifndef NASSERT +#ifdef CONFIG_SMP +#define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d for CPU%d\n", __FILE__,__LINE__, KeGetCurrentKPCR()->ProcessorNumber), KeBugCheck(0); } +#define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d for CPU%d\n", __FILE__,__LINE__, KeGetCurrentKPCR()->ProcessorNumber), KeBugCheck(0); } +#else #define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); KeBugCheck(0); } #define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); KeBugCheck(0); } +#endif #define assertmsg(_c_, _m_) \ if (!(_c_)) { \ diff --git a/reactos/ntoskrnl/include/internal/i386/ke.h b/reactos/ntoskrnl/include/internal/i386/ke.h index 4a6db727346..23d7d1c4b37 100644 --- a/reactos/ntoskrnl/include/internal/i386/ke.h +++ b/reactos/ntoskrnl/include/internal/i386/ke.h @@ -192,7 +192,7 @@ VOID KeFreeGdtSelector(ULONG Entry); VOID NtEarlyInitVdm(VOID); -#ifdef MP +#ifdef CONFIG_SMP #define LOCK "lock ; " #else #define LOCK "" diff --git a/reactos/ntoskrnl/include/internal/i386/ps.h b/reactos/ntoskrnl/include/internal/i386/ps.h index 6fb73b77d7f..c379029a83c 100644 --- a/reactos/ntoskrnl/include/internal/i386/ps.h +++ b/reactos/ntoskrnl/include/internal/i386/ps.h @@ -248,7 +248,7 @@ typedef struct _KPCR { #ifndef __USE_W32API -#ifdef MP +#ifdef CONFIG_SMP static inline PKPCR KeGetCurrentKPCR(VOID) { diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index 37d1bed8612..6e70fcc5919 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -193,7 +193,7 @@ KeInsertQueueDpc (PKDPC Dpc, // KeLowerIrql(OldIrql); //} -#ifdef MP +#ifdef CONFIG_SMP /* Get the right PCR for this CPU */ if (Dpc->Number >= MAXIMUM_PROCESSORS) { ASSERT (Dpc->Number - MAXIMUM_PROCESSORS < KeNumberProcessors); @@ -211,7 +211,7 @@ KeInsertQueueDpc (PKDPC Dpc, /* Get the DPC Data */ if (InterlockedCompareExchangeUL(&Dpc->DpcData, &Pcr->PrcbData.DpcData[0].DpcLock, 0)) { DPRINT("DPC Already Inserted"); -#ifdef MP +#ifdef CONFIG_SMP KiReleaseSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock); #endif KeLowerIrql(OldIrql); @@ -242,7 +242,7 @@ KeInsertQueueDpc (PKDPC Dpc, /* Make sure a DPC isn't executing already and respect rules outlined above. */ if ((!Pcr->PrcbData.DpcRoutineActive) && (!Pcr->PrcbData.DpcInterruptRequested)) { -#ifdef MP +#ifdef CONFIG_SMP /* Check if this is the same CPU */ if (Pcr != KeGetCurrentKPCR()) { /* Send IPI if High Importance */ @@ -280,7 +280,7 @@ KeInsertQueueDpc (PKDPC Dpc, } #endif } -#ifdef MP +#ifdef CONFIG_SMP KiReleaseSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock); #endif /* Lower IRQL */ @@ -309,7 +309,7 @@ KeRemoveQueueDpc (PKDPC Dpc) /* Raise IRQL */ DPRINT("Removing DPC: %x\n", Dpc); KeRaiseIrql(HIGH_LEVEL, &OldIrql); -#ifdef MP +#ifdef CONFIG_SMP KiAcquireSpinLock(&((PKDPC_DATA)Dpc->DpcData)->DpcLock); #endif @@ -322,7 +322,7 @@ KeRemoveQueueDpc (PKDPC Dpc) RemoveEntryList(&Dpc->DpcListEntry); } -#ifdef MP +#ifdef CONFIG_SMP KiReleaseSpinLock(&((PKDPC_DATA)Dpc->DpcData)->DpcLock); #endif @@ -494,7 +494,7 @@ KiDispatchInterrupt(VOID) if (Pcr->PrcbData.DpcData[0].DpcQueueDepth > 0) { /* Raise IRQL */ KeRaiseIrql(HIGH_LEVEL, &OldIrql); -#ifdef MP +#ifdef CONFIG_SMP KiAcquireSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock); #endif Pcr->PrcbData.DpcRoutineActive = TRUE; @@ -511,7 +511,7 @@ KiDispatchInterrupt(VOID) DPRINT("Dpc->DpcListEntry.Flink %x\n", Dpc->DpcListEntry.Flink); Dpc->DpcData = NULL; Pcr->PrcbData.DpcData[0].DpcQueueDepth--; -#ifdef MP +#ifdef CONFIG_SMP KiReleaseSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock); #endif /* Disable/Enabled Interrupts and Call the DPC */ @@ -523,7 +523,7 @@ KiDispatchInterrupt(VOID) Dpc->SystemArgument2); KeRaiseIrql(HIGH_LEVEL, &OldIrql); -#ifdef MP +#ifdef CONFIG_SMP KiAcquireSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock); /* * If the dpc routine drops the irql below DISPATCH_LEVEL, @@ -542,7 +542,7 @@ KiDispatchInterrupt(VOID) /* Clear DPC Flags */ Pcr->PrcbData.DpcRoutineActive = FALSE; Pcr->PrcbData.DpcInterruptRequested = FALSE; -#ifdef MP +#ifdef CONFIG_SMP KiReleaseSpinLock(&Pcr->PrcbData.DpcData[0].DpcLock); #endif diff --git a/reactos/ntoskrnl/ke/i386/fpu.c b/reactos/ntoskrnl/ke/i386/fpu.c index fe843be5d52..70a7577bb8f 100644 --- a/reactos/ntoskrnl/ke/i386/fpu.c +++ b/reactos/ntoskrnl/ke/i386/fpu.c @@ -1,4 +1,4 @@ -/* $Id: fpu.c,v 1.19 2004/11/27 23:50:26 hbirr Exp $ +/* $Id$ * * ReactOS kernel * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team @@ -69,7 +69,7 @@ ULONG HardwareMathSupport = 0; static ULONG MxcsrFeatureMask = 0, XmmSupport = 0; -ULONG FxsrSupport = 0; /* used by Ki386ContextSwitch for MP */ +ULONG FxsrSupport = 0; /* used by Ki386ContextSwitch for SMP */ /* FUNCTIONS *****************************************************************/ @@ -413,7 +413,7 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr) PKTHREAD CurrentThread; PFX_SAVE_AREA FxSaveArea; KIRQL oldIrql; -#ifndef MP +#ifndef CONFIG_SMP PKTHREAD NpxThread; #endif @@ -428,14 +428,14 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr) asm volatile("clts"); CurrentThread = KeGetCurrentThread(); -#ifndef MP +#ifndef CONFIG_SMP NpxThread = KeGetCurrentKPCR()->PrcbData.NpxThread; #endif ASSERT(CurrentThread != NULL); DPRINT("Device not present exception happened! (Cr0 = 0x%x, NpxState = 0x%x)\n", cr0, CurrentThread->NpxState); -#ifndef MP +#ifndef CONFIG_SMP /* check if the current thread already owns the FPU */ if (NpxThread != CurrentThread) /* FIXME: maybe this could be an assertation */ { @@ -456,7 +456,7 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr) } NpxThread->NpxState = NPX_STATE_VALID; } -#endif /* !MP */ +#endif /* !CONFIG_SMP */ /* restore the state of the current thread */ ASSERT((CurrentThread->NpxState & NPX_STATE_DIRTY) == 0); @@ -492,7 +492,7 @@ KiHandleFpuFault(PKTRAP_FRAME Tf, ULONG ExceptionNr) } } KeGetCurrentKPCR()->PrcbData.NpxThread = CurrentThread; -#ifndef MP +#ifndef CONFIG_SMP } #endif diff --git a/reactos/ntoskrnl/ke/i386/irq.c b/reactos/ntoskrnl/ke/i386/irq.c index 3668c85599b..9f110201348 100644 --- a/reactos/ntoskrnl/ke/i386/irq.c +++ b/reactos/ntoskrnl/ke/i386/irq.c @@ -47,7 +47,7 @@ /* GLOBALS *****************************************************************/ -#ifdef MP +#ifdef CONFIG_SMP #define __STR(x) #x #define STR(x) __STR(x) @@ -135,7 +135,7 @@ static ULONG irq_handler[ROUND_UP(NR_IRQS, 16)] = { #undef L #undef L16 -#else /* MP */ +#else /* CONFIG_SMP */ void irq_handler_0(void); void irq_handler_1(void); @@ -174,7 +174,7 @@ static unsigned int irq_handler[NR_IRQS]= (int)&irq_handler_15, }; -#endif /* MP */ +#endif /* CONFIG_SMP */ /* * PURPOSE: Object describing each isr @@ -190,7 +190,7 @@ typedef struct } ISR_TABLE, *PISR_TABLE; -#ifdef MP +#ifdef CONFIG_SMP static ISR_TABLE IsrTable[NR_IRQS][MAXIMUM_PROCESSORS]; #else static ISR_TABLE IsrTable[NR_IRQS][1]; @@ -217,7 +217,7 @@ KeInitInterrupts (VOID) KiIdt[IRQ_BASE+i].a=(irq_handler[i]&0xffff)+(KERNEL_CS<<16); KiIdt[IRQ_BASE+i].b=(irq_handler[i]&0xffff0000)+PRESENT+ I486_INTERRUPT_GATE; -#ifdef MP +#ifdef CONFIG_SMP for (j = 0; j < MAXIMUM_PROCESSORS; j++) #else j = 0; @@ -352,7 +352,7 @@ KiInterruptDispatch (ULONG vector, PKIRQ_TRAPFRAME Trapframe) */ Ke386EnableInterrupts(); -#ifndef MP +#ifndef CONFIG_SMP if (VECTOR2IRQ(vector) == 0) { KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame); diff --git a/reactos/ntoskrnl/ke/i386/multiboot.S b/reactos/ntoskrnl/ke/i386/multiboot.S index d8b41891124..de6ef8ca290 100644 --- a/reactos/ntoskrnl/ke/i386/multiboot.S +++ b/reactos/ntoskrnl/ke/i386/multiboot.S @@ -12,11 +12,11 @@ #define V2P(x) (x - KERNEL_BASE + 0x200000) -#ifdef MP +#ifdef CONFIG_SMP #define AP_MAGIC (0x12481020) -#endif /* MP */ +#endif /* CONFIG_SMP */ .globl _NtProcessStartup .globl _start @@ -79,7 +79,7 @@ _multiboot_entry: */ cld -#ifdef MP +#ifdef CONFIG_SMP /* * Save the multiboot or application processor magic @@ -89,7 +89,7 @@ _multiboot_entry: cmpl $AP_MAGIC, %edx je .m1 -#endif /* MP */ +#endif /* CONFIG_SMP */ /* * Zero the BSS @@ -115,9 +115,9 @@ _multiboot_entry: movl $(V2P(startup_pagedirectory) + 0x3), 0xF00(%esi) movl $(V2P(kernelmap_pagetable) + 0x3), 0xF0C(%esi) -#ifdef MP +#ifdef CONFIG_SMP movl $(V2P(apic_pagetable) + 0x3), 0xFEC(%esi) -#endif /* MP */ +#endif /* CONFIG_SMP */ movl $(V2P(kpcr_pagetable) + 0x3), 0xFF0(%esi) /* @@ -146,7 +146,7 @@ _multiboot_entry: cmpl $6144, %edi jl .l4 -#ifdef MP +#ifdef CONFIG_SMP /* * Initialize the page table that maps the APIC register address space @@ -164,7 +164,7 @@ _multiboot_entry: movl $0xFEE0001B, %eax movl %eax, (%esi, %edi) -#endif /* MP */ +#endif /* CONFIG_SMP */ /* * Initialize the page table that maps the initial KPCR (at FF000000) @@ -175,7 +175,7 @@ _multiboot_entry: movl %eax, (%esi, %edi) -#ifdef MP +#ifdef CONFIG_SMP .m1: /* @@ -203,7 +203,7 @@ _multiboot_entry: .m3: -#endif /* MP */ +#endif /* CONFIG_SMP */ /* * Set up the PDBR @@ -211,7 +211,7 @@ _multiboot_entry: movl $(V2P(startup_pagedirectory)), %eax movl %eax, %cr3 -#ifdef MP +#ifdef CONFIG_SMP .m4: #endif @@ -249,7 +249,7 @@ _multiboot_entry: movl $0, %eax movl %eax, %fs -#ifdef MP +#ifdef CONFIG_SMP cmpl $AP_MAGIC, %edx jne .m2 @@ -292,7 +292,7 @@ _multiboot_entry: .m2: -#endif /* MP */ +#endif /* CONFIG_SMP */ /* * Load the PCR selector @@ -355,10 +355,10 @@ kernelmap_pagetable: .fill 4096, 1, 0 _pae_pagedirtable: .fill 4096, 1, 0 -#ifdef MP +#ifdef CONFIG_SMP apic_pagetable: .fill 4096, 1, 0 -#endif /* MP */ +#endif /* CONFIG_SMP */ kpcr_pagetable: .fill 4096, 1, 0 diff --git a/reactos/ntoskrnl/ke/i386/tskswitch.S b/reactos/ntoskrnl/ke/i386/tskswitch.S index badd8855f1e..a97577fa5ee 100644 --- a/reactos/ntoskrnl/ke/i386/tskswitch.S +++ b/reactos/ntoskrnl/ke/i386/tskswitch.S @@ -60,7 +60,7 @@ _Ki386ContextSwitch: */ cli -#ifdef MP +#ifdef CONFIG_SMP /* * Get the pointer to the old thread. */ @@ -81,7 +81,7 @@ _Ki386ContextSwitch: 2: movb $NPX_STATE_VALID, KTHREAD_NPX_STATE(%ebx) 3: -#endif /* MP */ +#endif /* CONFIG_SMP */ /* @@ -182,10 +182,10 @@ _Ki386ContextSwitch: * Set TS in cr0 to catch FPU code and load the FPU state when needed * For uni-processor we do this only if NewThread != KPCR->NpxThread */ -#ifndef MP +#ifndef CONFIG_SMP cmpl %ebx, %fs:KPCR_NPX_THREAD je 4f -#endif /* !MP */ +#endif /* !CONFIG_SMP */ movl %cr0, %eax orl $X86_CR0_TS, %eax movl %eax, %cr0 diff --git a/reactos/ntoskrnl/ke/kthread.c b/reactos/ntoskrnl/ke/kthread.c index 8651c5e5aaf..29787c05301 100644 --- a/reactos/ntoskrnl/ke/kthread.c +++ b/reactos/ntoskrnl/ke/kthread.c @@ -309,7 +309,7 @@ VOID STDCALL KeRevertToUserAffinityThread(VOID) { -#ifdef MP +#ifdef CONFIG_SMP PKTHREAD CurrentThread; KIRQL oldIrql; @@ -366,7 +366,7 @@ VOID STDCALL KeSetSystemAffinityThread(IN KAFFINITY Affinity) { -#ifdef MP +#ifdef CONFIG_SMP PKTHREAD CurrentThread; KIRQL oldIrql; diff --git a/reactos/ntoskrnl/ke/spinlock.c b/reactos/ntoskrnl/ke/spinlock.c index 284d19792ad..c4a0754c815 100644 --- a/reactos/ntoskrnl/ke/spinlock.c +++ b/reactos/ntoskrnl/ke/spinlock.c @@ -187,12 +187,23 @@ KiAcquireSpinLock(PKSPIN_LOCK SpinLock) while ((i = InterlockedExchangeUL(SpinLock, 1)) == 1) { -#ifndef MP +#ifdef CONFIG_SMP + /* Avoid reading the value again too fast */ +#if 1 + __asm__ __volatile__ ("1:\n\t" + "cmpl $0,(%0)\n\t" + "jne 1b\n\t" + : + : "r" (SpinLock)); +#else + while (0 != *(volatile PKSPIN_LOCK)SpinLock) + { + } +#endif +#else DbgPrint("Spinning on spinlock %x current value %x\n", SpinLock, i); KEBUGCHECK(0); -#else /* not MP */ - /* Avoid reading the value again too fast */ -#endif /* MP */ +#endif /* CONFIG_SMP */ } } diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index 6daca270538..845ef90feb2 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -289,7 +289,7 @@ MmInit1(ULONG FirstKrnlPhysAddr, { ULONG i; ULONG kernel_len; -#ifndef MP +#ifndef CONFIG_SMP extern unsigned int unmap_me, unmap_me2, unmap_me3; #endif @@ -394,7 +394,7 @@ MmInit1(ULONG FirstKrnlPhysAddr, /* * Unmap low memory */ -#ifndef MP +#ifndef CONFIG_SMP /* In SMP mode we unmap the low memory in MmInit3. The APIC needs the mapping of the first pages while the processors are starting up. */ @@ -417,7 +417,7 @@ MmInit1(ULONG FirstKrnlPhysAddr, } DPRINT("Almost done MmInit()\n"); -#ifndef MP +#ifndef CONFIG_SMP /* FIXME: This is broken in SMP mode */ MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me, TRUE, NULL, NULL); MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me2, TRUE, NULL, NULL); @@ -446,7 +446,7 @@ MmInit3(VOID) /* * Unmap low memory */ -#ifdef MP +#ifdef CONFIG_SMP /* In SMP mode we can unmap the low memory if all processors are started. */ MmDeletePageTable(NULL, 0); diff --git a/reactos/tools/config.mk b/reactos/tools/config.mk index f95ae01664f..26ecb208a68 100644 --- a/reactos/tools/config.mk +++ b/reactos/tools/config.mk @@ -15,10 +15,8 @@ ifeq ($(KDBG), 1) CONFIG += KDBG endif -ifeq ($(MP), 1) -CONFIG += MP -else -CONFIG += UP +ifeq ($(CONFIG_SMP), 1) +CONFIG += CONFIG_SMP endif ifeq ($(ACPI), 1) diff --git a/reactos/tools/mkconfig.c b/reactos/tools/mkconfig.c index 3d8cf14dd8c..3ab1631c6c0 100644 --- a/reactos/tools/mkconfig.c +++ b/reactos/tools/mkconfig.c @@ -106,12 +106,6 @@ main(int argc, char* argv[]) { 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, "#endif /* ! defined(MP) && ! defined(UP) */\n"); - } else { s = s + sprintf(s, "#define %s\n", argv[i]);