From a76bc939142f61e615fcc39fc940961e39a26207 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 19 Sep 2020 21:51:22 +0200 Subject: 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 (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 * 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. --- kern/cpu_number.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kern') diff --git a/kern/cpu_number.h b/kern/cpu_number.h index e7b65324..0be2d338 100644 --- a/kern/cpu_number.h +++ b/kern/cpu_number.h @@ -27,6 +27,8 @@ #ifndef _KERN_CPU_NUMBER_H_ #define _KERN_CPU_NUMBER_H_ +#include + /* * Definitions for cpu identification in multi-processors. */ -- cgit v1.2.3