Page MenuHomeFreeBSD

linuxkpi: Define `DEFINE_CLASS()` and `CLASS()`
Needs ReviewPublic

Authored by dumbbell on Sun, Jun 14, 9:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 19, 7:06 AM
Unknown Object (File)
Thu, Jun 18, 9:38 PM
Unknown Object (File)
Thu, Jun 18, 1:08 PM
Unknown Object (File)
Wed, Jun 17, 4:23 PM
Unknown Object (File)
Mon, Jun 15, 2:17 PM
Unknown Object (File)
Mon, Jun 15, 2:14 PM
Unknown Object (File)
Mon, Jun 15, 3:54 AM
Unknown Object (File)
Sun, Jun 14, 6:24 PM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

DEFINE_CLASS() is in fact named LINUXKPI_DEFINE_CLASS() because it conflicts with DEFINE_CLASS() defined in <sys/kobj.h>.

This macro defines a type and a pair of constructor/destructor functions.

They are to be used by CLASS(): this one declares a variable, initialise it with the constructor and set the __cleanup() attribute to call the destructor once the variable goes out of scope.

The DRM drivers generic code started to use CLASS() in Linux 6.13. It requires the fd class to be defined in <linux/file.h>.

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