From c3d326fd44d9cf4649aa35a62a2766155c8b383d Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 5 Feb 2020 19:08:21 +0000 Subject: [PATCH] Define MAXCPU consistently between the kernel and KLDs. This reverts r177661. The change is no longer very useful since out-of-tree KLDs will be built to target SMP kernels anyway. Moveover it breaks the KBI in !SMP builds since cpuset_t's layout depends on the value of MAXCPU, and several kernel interfaces, notably smp_rendezvous_cpus(), take a cpuset_t as a parameter. PR: 243711 Reviewed by: jhb, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23512 --- sys/amd64/include/param.h | 2 +- sys/arm/include/param.h | 4 ++-- sys/arm64/include/param.h | 4 ++-- sys/i386/include/param.h | 4 ++-- sys/powerpc/include/param.h | 4 ++-- sys/riscv/include/param.h | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 86f7e08d9725..ac3df693e4d4 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -65,7 +65,7 @@ #define MACHINE_ARCH32 "i386" #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 256 #endif diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index 39dcc5e341bf..ff5c271dfb2e 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -75,13 +75,13 @@ #define MACHINE_ARCH "arm" _V_SUFFIX _EB_SUFFIX #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 4 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 1 diff --git a/sys/arm64/include/param.h b/sys/arm64/include/param.h index 63c603bed3ed..1164965ca12f 100644 --- a/sys/arm64/include/param.h +++ b/sys/arm64/include/param.h @@ -54,13 +54,13 @@ #define MACHINE_ARCH32 "armv7" #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 256 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 2 diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 7b1d05eebf15..260ef14c9431 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -58,13 +58,13 @@ #endif #define MID_MACHINE MID_I386 -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 32 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 1 diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h index 8c43f5a8faae..c7726049fc1a 100644 --- a/sys/powerpc/include/param.h +++ b/sys/powerpc/include/param.h @@ -73,13 +73,13 @@ #endif #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 256 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 8 diff --git a/sys/riscv/include/param.h b/sys/riscv/include/param.h index 4b4610bea8d1..94e18c580417 100644 --- a/sys/riscv/include/param.h +++ b/sys/riscv/include/param.h @@ -49,13 +49,13 @@ #define MACHINE_ARCH "riscv64" #endif -#if defined(SMP) || defined(KLD_MODULE) +#ifdef SMP #ifndef MAXCPU #define MAXCPU 16 #endif #else #define MAXCPU 1 -#endif /* SMP || KLD_MODULE */ +#endif #ifndef MAXMEMDOM #define MAXMEMDOM 1