summaryrefslogtreecommitdiff
path: root/configfrag.ac
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-09-19 21:51:22 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-09-19 21:55:57 +0200
commita76bc939142f61e615fcc39fc940961e39a26207 (patch)
tree5224c805761fd68311de079f32b7c4ef0c613bf6 /configfrag.ac
parentb26973c8018b99bcf8fb071eb2aedc634039eea1 (diff)
smp: Add --enable-ncpus option and fix build
* configfrag.ac (--enable-ncpus): Add option to set $mach_ncpus. * i386/i386/cpu_number.h (CPU_NUMBER, cpu_number): New macros, set to 0 for now. * i386/i386/db_interface.c (cpu_interrupt_to_db): New function. * i386/i386/db_interface.h (cpu_interrupt_to_db): New declaration. * i386/i386/mp_desc.c (int_stack_base): New array. (intel_startCPU): New function. * i386/i386at/model_dep.c: Include <i386/smp.h> (int_stack_top, int_stack_base): Turn into arrays (i386at_init): Update accesses accordingly. * i386/i386at/model_dep.h (int_stack_top, int_stack_base, ON_INT_STACK): Likewise. * i386/intel/pmap.c (cpus_active, cpus_idle, cpu_update_needed): Add variables. * i386/intel/pmap.h (cpus_active, cpus_idle, cpu_update_needed): Mark extern. * kern/cpu_number.h: Include <machine/cpu_number.h> * linux/dev/arch/i386/kernel/irq.c (local_bh_count, local_irq_count): Hardcode to the address of intr_count. We will not use the Linux code in SMP mode anyway.
Diffstat (limited to 'configfrag.ac')
-rw-r--r--configfrag.ac5
1 files changed, 4 insertions, 1 deletions
diff --git a/configfrag.ac b/configfrag.ac
index 91d737ef..3c3ba3aa 100644
--- a/configfrag.ac
+++ b/configfrag.ac
@@ -45,7 +45,10 @@ AC_DEFINE([BOOTSTRAP_SYMBOLS], [0], [BOOTSTRAP_SYMBOLS])
# Multiprocessor support is still broken.
AH_TEMPLATE([MULTIPROCESSOR], [set things up for a uniprocessor])
-mach_ncpus=1
+AC_ARG_ENABLE([ncpus],
+ AS_HELP_STRING([--enable-ncpus=N], [specify the maximum number of cpus to be supported]),
+ [mach_ncpus=$enable_ncpus],
+ [mach_ncpus=1])
AC_DEFINE_UNQUOTED([NCPUS], [$mach_ncpus], [number of CPUs])
[if [ $mach_ncpus -gt 1 ]; then]
AC_DEFINE([MULTIPROCESSOR], [1], [set things up for a multiprocessor])