From 955c51b4d43fbeb5b24d70d80203c05cbf2e6894 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sat, 5 Aug 2023 15:49:08 +0000 Subject: kern/thread: Only loop over cpus that exist Message-Id: <20230805154859.2003109-1-damien@zamaudio.com> --- 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 #include #include +#include #include #include #include @@ -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; -- cgit v1.2.3