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)
Sat, Oct 11, 6:51 PM
Unknown Object (File)
Sat, Oct 11, 6:49 PM
Unknown Object (File)
Sat, Oct 11, 6:49 PM
Unknown Object (File)
Sat, Oct 11, 10:02 AM
Unknown Object (File)
Thu, Oct 9, 12:39 AM
Unknown Object (File)
Sun, Oct 5, 6:00 AM
Unknown Object (File)
Sep 11 2025, 8:40 PM
Unknown Object (File)
Aug 14 2025, 9:04 AM

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