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)
Sun, Jun 7, 12:30 PM
Unknown Object (File)
Wed, May 27, 7:08 PM
Unknown Object (File)
Wed, May 27, 3:53 AM
Unknown Object (File)
Tue, May 26, 2:20 AM
Unknown Object (File)
May 17 2026, 11:59 AM
Unknown Object (File)
May 17 2026, 11:39 AM
Unknown Object (File)
May 16 2026, 8:19 PM
Unknown Object (File)
May 14 2026, 5:47 AM
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