diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-08-05 15:49:08 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-06 15:40:31 +0200 |
commit | 955c51b4d43fbeb5b24d70d80203c05cbf2e6894 (patch) | |
tree | d7153a9e3294f1d55eb88d466a9146291173b72b | |
parent | c9e2acff14cbacce707f07410744fad575f4b78b (diff) | |
download | gnumach-955c51b4d43fbeb5b24d70d80203c05cbf2e6894.tar.gz gnumach-955c51b4d43fbeb5b24d70d80203c05cbf2e6894.tar.bz2 gnumach-955c51b4d43fbeb5b24d70d80203c05cbf2e6894.zip |
kern/thread: Only loop over cpus that exist
Message-Id: <20230805154859.2003109-1-damien@zamaudio.com>
-rw-r--r-- | kern/thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |