Page MenuHomeFreeBSD

linuxkpi: Split <linux/compiler.h>
ClosedPublic

Authored by dumbbell on Jan 4 2026, 10:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 20, 5:14 AM
Unknown Object (File)
Sun, Aug 16, 6:33 PM
Unknown Object (File)
Sun, Aug 16, 6:33 PM
Unknown Object (File)
Wed, Aug 12, 12:56 PM
Unknown Object (File)
Wed, Aug 12, 12:38 PM
Unknown Object (File)
Mon, Aug 10, 6:25 PM
Unknown Object (File)
Sun, Aug 9, 4:52 AM
Unknown Object (File)
Sat, Aug 8, 9:56 PM
Subscribers

Details

Summary

On Linux, they split the content into three headers:

  1. <linux/compiler.h>
  2. <linux/compiler_types.h>
  3. <linux/compiler_attributes.h>

The first includes the second, which includes the third.

<linux/compiler_types.h> is also included on the compiler command line by default! I added that to the compilation flags of the DRM drivers.

This allowed me to drop at least one:

#ifdef __FreeBSD
#include <linux/compiler.h>
#endif

Note that our copy of <linux/compiler.h> contains definitions which are not defined by Linux' <linux/compiler.h>. I left them alone.

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

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jan 5 2026, 5:05 PM
This revision was automatically updated to reflect the committed changes.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/compiler.h
36

What is the reason not to include them as <linux/compiler_types.h> here and in the other file if that is an official Linux[KPI] include file?

sys/compat/linuxkpi/common/include/linux/compiler.h
36

Mmm, probably should be