Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/freebsd-src.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2022-11-11 20:43:07 +0300
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2022-11-11 20:43:07 +0300
commit58cf3a69a5590a159b6271b0cb74bbec72245f26 (patch)
tree01bbc14f5a6239fcc104024e07395227c927e706
parentc4163160e44d1f329301b0fe943854b9dc0750dc (diff)
linuxkpi: Define `boot_cpu_data.x86_max_cores`
Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D36971
-rw-r--r--sys/compat/linuxkpi/common/include/asm/processor.h1
-rw-r--r--sys/compat/linuxkpi/common/src/linux_compat.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/asm/processor.h b/sys/compat/linuxkpi/common/include/asm/processor.h
index 0b34031392ac..86d4ab9de98f 100644
--- a/sys/compat/linuxkpi/common/include/asm/processor.h
+++ b/sys/compat/linuxkpi/common/include/asm/processor.h
@@ -36,6 +36,7 @@
struct cpuinfo_x86 {
uint8_t x86;
uint16_t x86_clflush_size;
+ uint16_t x86_max_cores;
};
extern struct cpuinfo_x86 boot_cpu_data;
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
index 26af40836c64..30cc094a5222 100644
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -2766,6 +2766,7 @@ linux_compat_init(void *arg)
#if defined(__i386__) || defined(__amd64__)
linux_cpu_has_clflush = (cpu_feature & CPUID_CLFSH);
boot_cpu_data.x86_clflush_size = cpu_clflush_line_size;
+ boot_cpu_data.x86_max_cores = mp_ncpus;
boot_cpu_data.x86 = ((cpu_id & 0xf0000) >> 12) | ((cpu_id & 0xf0) >> 4);
#endif
rw_init(&linux_vma_lock, "lkpi-vma-lock");