From 1effd8ff6823f72a7112941201d9ef24e791f852 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sat, 24 Sep 2005 19:34:54 +0000 Subject: [PATCH] Allow the system process and a process without a parent process to use all cpus on a smp machine, even if only the boot cpu is running. svn path=/trunk/; revision=18035 --- reactos/ntoskrnl/ps/process.c | 7 +++++++ reactos/ntoskrnl/ps/psmgr.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 9901e475afc..e2f36f75c3f 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -220,7 +220,14 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, else { pParentProcess = NULL; +#ifdef CONFIG_SMP + /* FIXME: + * Only the boot cpu is initialized in the early boot phase. + */ + Affinity = 0xffffffff; +#else Affinity = KeActiveProcessors; +#endif } /* Add the debug port */ diff --git a/reactos/ntoskrnl/ps/psmgr.c b/reactos/ntoskrnl/ps/psmgr.c index 2f6cad59a00..76172772477 100644 --- a/reactos/ntoskrnl/ps/psmgr.c +++ b/reactos/ntoskrnl/ps/psmgr.c @@ -220,7 +220,15 @@ PsInitProcessManagment(VOID) /* System threads may run on any processor. */ RtlZeroMemory(PsInitialSystemProcess, sizeof(EPROCESS)); +#ifdef CONFIG_SMP + /* FIXME: + * Only the boot cpu is initialized. Threads of the + * system process should be able to run on all cpus. + */ + PsInitialSystemProcess->Pcb.Affinity = 0xffffffff; +#else PsInitialSystemProcess->Pcb.Affinity = KeActiveProcessors; +#endif PsInitialSystemProcess->Pcb.IopmOffset = 0xffff; PsInitialSystemProcess->Pcb.BasePriority = PROCESS_PRIORITY_NORMAL; PsInitialSystemProcess->Pcb.QuantumReset = 6;