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, May 18, 1:50 AM
Unknown Object (File)
Mon, May 18, 1:50 AM
Unknown Object (File)
Mon, May 18, 1:37 AM
Unknown Object (File)
Mon, May 18, 1:37 AM
Unknown Object (File)
Sat, May 9, 1:24 PM
Unknown Object (File)
Fri, May 8, 11:00 PM
Unknown Object (File)
Wed, May 6, 11:01 PM
Unknown Object (File)
Sun, May 3, 3:57 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