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)
Mon, Jan 27, 5:01 PM
Unknown Object (File)
Sat, Jan 18, 9:38 PM
Unknown Object (File)
Nov 25 2024, 7:41 PM
Unknown Object (File)
Nov 25 2024, 4:42 AM
Unknown Object (File)
Nov 24 2024, 3:34 PM
Unknown Object (File)
Nov 21 2024, 11:34 AM
Unknown Object (File)
Nov 20 2024, 9:45 AM
Unknown Object (File)
Nov 14 2024, 4:14 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