Page MenuHomeFreeBSD

linuxkpi: Define `cpu_data(cpu)`
ClosedPublic

Authored by dumbbell on Feb 12 2023, 10:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 18, 12:20 AM
Unknown Object (File)
Nov 13 2025, 4:51 PM
Unknown Object (File)
Nov 10 2025, 7:37 PM
Unknown Object (File)
Nov 6 2025, 1:13 PM
Unknown Object (File)
Nov 3 2025, 8:21 AM
Unknown Object (File)
Oct 11 2025, 6:51 PM
Unknown Object (File)
Oct 11 2025, 6:49 PM
Unknown Object (File)
Oct 11 2025, 6:49 PM

Details

Summary

cpu_data(cpu) evaluates to a struct cpuinfo_x86 filled with attributes of the given CPU number. The CPU number is an index in the __cpu_data[] array with MAXCPU entries. On FreeBSD, we simply initialize all of them like we do with boot_cpu_data.

While here, we add the x86_model field to the struct cpuinfo_x86. We use CPUID_TO_MODEL() to set it.

At the same time, we fix the value of x86 which should have been set to the CPU family. It was using the same implementation as CPUID_TO_MODEL() before. It now uses CPUID_TO_FAMILY().

This is part of the update of the DRM drivers to Linux 5.15.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable