HomeFreeBSD

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

Description

linuxkpi: Alias sd field of struct kobject

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.

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57586

Details

Provenance
dumbbellAuthored on Jun 12 2026, 8:44 PM
Reviewer
bz
Differential Revision
D57586: linuxkpi: Alias `sd` field of `struct kobject`
Parents
rG37321270b630: amd64/arm64 pmap: consistently clear PGA_WRITEABLE
Branches
Unknown
Tags
Unknown