Page MenuHomeFreeBSD

linuxkpi: Alias `sd` field of `struct kobject`
Needs ReviewPublic

Authored by dumbbell on Sun, Jun 14, 9:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 15, 5:46 PM
Unknown Object (File)
Mon, Jun 15, 2:11 PM
Unknown Object (File)
Sun, Jun 14, 6:25 PM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

On Linux, a struct kernfs_node * pointer, representing a directory in sysfs, is kept in the sd struct field.

We don't have that on FreeBSD because we use sysctls instead. Let's alias the sysctl OID pointer to sd using an union.

This pointer is checked by the DRM drivers using:

if (var->kobj.sd) {
    ...
}

The amdgpu DRM driver started to use these checks in Linux 6.13.

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

Sponsored by: The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped