bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH gnumach] kern/thread: Only loop over cpus that exist


From: Damien Zammit
Subject: [PATCH gnumach] kern/thread: Only loop over cpus that exist
Date: Sat, 05 Aug 2023 15:49:08 +0000

---
 kern/thread.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kern/thread.c b/kern/thread.c
index a324eed7..9bbe8342 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -57,6 +57,7 @@
 #include <kern/host.h>
 #include <kern/kalloc.h>
 #include <kern/slab.h>
+#include <kern/smp.h>
 #include <kern/mach_clock.h>
 #include <vm/vm_kern.h>
 #include <vm/vm_user.h>
@@ -2570,7 +2571,7 @@ kern_return_t processor_set_stack_usage(
 
                        stack = thread->kernel_stack;
 
-                       for (cpu = 0; cpu < NCPUS; cpu++)
+                       for (cpu = 0; cpu < smp_get_numcpus(); cpu++)
                                if (active_threads[cpu] == thread) {
                                        stack = active_stacks[cpu];
                                        break;
-- 
2.40.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]