| #
33fa585a
|
| 17-Aug-2025 |
Jean-Sébastien Pédron <dumbbell@FreeBSD.org> |
linuxkpi: Split <linux/compiler.h>
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 sec
linuxkpi: Split <linux/compiler.h>
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.
Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54495
show more ...
|
| #
0a4b11dd
|
| 11-Oct-2025 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: add __counted_by_le() and __counted_by_be()
The former is needed by a wireless driver at v6.17.
MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.free
LinuxKPI: add __counted_by_le() and __counted_by_be()
The former is needed by a wireless driver at v6.17.
MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D53203
show more ...
|
| #
ff5bcb74
|
| 18-Aug-2025 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: add __struct_size
Use __builtin_object_size() by default. If __builtin_dynamic_object_size() is available use that instead.
I would hope that in a future version we can remove the conditi
LinuxKPI: add __struct_size
Use __builtin_object_size() by default. If __builtin_dynamic_object_size() is available use that instead.
I would hope that in a future version we can remove the conditional checks but in order to be able to MFC this without checking all compiler versions simply keep it this way for now.
Sponsored by: The FreeBSD Foundation (initially) MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52077
show more ...
|
| #
16672453
|
| 15-Oct-2024 |
Warner Losh <imp@FreeBSD.org> |
cdefs: Add __deprecated
Add __deprecated decorator. This is for a deprecated interface. copystr is tagged with this today in copy(9), but don't actually provide it or use it. copystr is a #define so
cdefs: Add __deprecated
Add __deprecated decorator. This is for a deprecated interface. copystr is tagged with this today in copy(9), but don't actually provide it or use it. copystr is a #define so adding it will have to wait.
LinuxKPI was defining this away completely in compiler.h. Since this is shared between Linux KPI consumers and OpenZFS, if it's already defined, use the FreeBSD sys/cdefs.h version, otherwise define it away. For OpenZFS this will retain it, while for Linux KPI it will tend to drop it (I think always, but I didn't look at everything).
Sponsored by: Netflix Reviewed by: jhb, emaste Differential Revision: https://reviews.freebsd.org/D46137
show more ...
|
| #
742088d9
|
| 21-Jul-2024 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Add __diag macros
__diag macros turn individual warnings and errors on and off locally, depending on version of compiler. Add dummy implementation as drm-kmod set warnings separately for e
LinuxKPI: Add __diag macros
__diag macros turn individual warnings and errors on and off locally, depending on version of compiler. Add dummy implementation as drm-kmod set warnings separately for each file.
Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D45842
show more ...
|
| #
2a8c5059
|
| 02-Apr-2024 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: add __counted_by() and __nonstring
Add checks for __counted_by(_x) and __nonstring as and depending on compiler support enable the attribute/feature.
This is needed to make mtk76 and ath1
LinuxKPI: add __counted_by() and __nonstring
Add checks for __counted_by(_x) and __nonstring as and depending on compiler support enable the attribute/feature.
This is needed to make mtk76 and ath1xk drivers compile.
Sposnored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste, dim Differential Revision: https://reviews.freebsd.org/D44587
show more ...
|
| #
3208d4ad
|
| 08-Apr-2024 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Import vanilla linux/overflow.h
It is dual-licensed (GPLv2 & MIT) and self-contained header file. No need to reimplement it.
Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste
LinuxKPI: Import vanilla linux/overflow.h
It is dual-licensed (GPLv2 & MIT) and self-contained header file. No need to reimplement it.
Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week
show more ...
|
| #
95ee2897
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| #
046d8d89
|
| 13-May-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE()
Fix a gcc warning: "to be safe all intermediate pointers in cast from '...' to '...' must be 'const' qualified [-Wcast-qual]". Doing what is essentia
LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE()
Fix a gcc warning: "to be safe all intermediate pointers in cast from '...' to '...' must be 'const' qualified [-Wcast-qual]". Doing what is essentially a __DECONST() adding the uintptr_t gets rid of the massive amount of warnings we get in LinuxKPI and lets us see the actual problems a lot better. This is a follow-up to 74e908b3c63b28de1d590dc42502fbe959a6da2e which fixed READ_ONCE(). ACCESS_ONCE() seems to be an obsolete KPI these days in Linux and FreeBSD does not use it either directly so we can entirely remove it now.
Sponsored by: The FreeBSD Foundation Suggested by: jhb Reviewed by: hselasky MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D40084
show more ...
|
| #
53d821d6
|
| 22-Apr-2023 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Define noinline_for_stack compiler attribute
It is identical to noinline and used for documentation reasons.
Required by: drm-kmod 5.15-lts Reviewed by: manu Differential Revision: https:
LinuxKPI: Define noinline_for_stack compiler attribute
It is identical to noinline and used for documentation reasons.
Required by: drm-kmod 5.15-lts Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D39553
show more ...
|
| #
74e908b3
|
| 19-Apr-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: fix READ_ONCE() -Wcast-equal warnings
Rather than using ACCESS_ONCE() in READ_ONCE() add a missing cast to const in order to satisfy -Wcast-equal by gcc. Sadly we cannot do the same to WRI
LinuxKPI: fix READ_ONCE() -Wcast-equal warnings
Rather than using ACCESS_ONCE() in READ_ONCE() add a missing cast to const in order to satisfy -Wcast-equal by gcc. Sadly we cannot do the same to WRITE_ONCE() which still is very noisy.
Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D39706
show more ...
|
| #
e5b95b22
|
| 09-Feb-2022 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: add sizeof_field()
Add sizeof_field() to linux/compiler.h needed by a driver.
MFC after: 3 days Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D34226
|
| #
307f78f3
|
| 19-Dec-2021 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards
MFC after: 1 week Reviewed by: bz, emaste, hselasky, manu Differential Revision: https://reviews.freebsd.org/D33562
|
| #
2fb5be79
|
| 04-Jul-2021 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Implement smp_*mb barriers with atomic_thread_fence_*
for x86 and move them to asm/barrier.h
MFC after: 1 week Reviewed by: bz, hselasky, manu Differential Revision: https://reviews.freeb
LinuxKPI: Implement smp_*mb barriers with atomic_thread_fence_*
for x86 and move them to asm/barrier.h
MFC after: 1 week Reviewed by: bz, hselasky, manu Differential Revision: https://reviews.freebsd.org/D33296
show more ...
|
| #
da717031
|
| 24-May-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: compiler.h add three more defines
Add fallthrough, ____cacheline_aligned_in_smp, and smp_mb() to linux/compiler.h.
Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: hse
LinuxKPI: compiler.h add three more defines
Add fallthrough, ____cacheline_aligned_in_smp, and smp_mb() to linux/compiler.h.
Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30420
show more ...
|
| #
43b4c006
|
| 24-May-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: extract stringify() in their own header file
Add linux/stringify.h as directly included by drivers. Remove the definitions from compiler.h and include the new header in places where the s
LinuxKPI: extract stringify() in their own header file
Add linux/stringify.h as directly included by drivers. Remove the definitions from compiler.h and include the new header in places where the stringify macros are already used without linuxkpi.
I have adjusted the Copyright of the new file according to the commit originaly adding the macros (99e690772adbcb78c9e8441bedcf1913d72ea72f).
Sposnored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30440
show more ...
|
| #
3b1ecc9f
|
| 23-Mar-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: remove < 5.0 version support
We are not aware of any out-of-tree consumers anymore which would need KPI support for before Linux version 5. Update the two in-tree consumers to use the new
LinuxKPI: remove < 5.0 version support
We are not aware of any out-of-tree consumers anymore which would need KPI support for before Linux version 5. Update the two in-tree consumers to use the new KPI. This allows us to remove the extra version check and will also give access to {lower,upper}_32_bits() unconditionally.
Sponsored-by: The FreeBSD Foundation Reviewed-by: hselasky, rlibby, rstone MFC-after: 2 weeks X-MFC: to 13 only Differential Revision: https://reviews.freebsd.org/D29391
show more ...
|
| #
93d70cd3
|
| 25-May-2020 |
Emmanuel Vadot <manu@FreeBSD.org> |
linuxkpi: Add __same_type and __must_be_array macros
The same_type macro simply wraps around builtin_types_compatible_p which exist for both GCC and CLANG, which returns 1 if both types are the same
linuxkpi: Add __same_type and __must_be_array macros
The same_type macro simply wraps around builtin_types_compatible_p which exist for both GCC and CLANG, which returns 1 if both types are the same. The __must_be_array macros returns 1 if the argument is an array.
This is needed for DRM v5.3
Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24953
show more ...
|
| #
482f0c02
|
| 15-Dec-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Revert r355760, r355759
And remove the inline/deprecated attribute use entirely in stdlib.h, from r355747. The intent was to provide a buildable API transitionary period, but clearly that was count
Revert r355760, r355759
And remove the inline/deprecated attribute use entirely in stdlib.h, from r355747. The intent was to provide a buildable API transitionary period, but clearly that was counter-productive.
Reported by: delphij, imp, others
show more ...
|
| #
9d471059
|
| 14-Dec-2019 |
Conrad Meyer <cem@FreeBSD.org> |
linuxkpi: Drop incompatible __deprecated definition
Probably all of these linuxkpi stubs should be '#ifndef' guarded, but maybe that would prevent people from noticing when they are defined.
Introd
linuxkpi: Drop incompatible __deprecated definition
Probably all of these linuxkpi stubs should be '#ifndef' guarded, but maybe that would prevent people from noticing when they are defined.
Introduced in r355759. For some reason I only ran a buildworld and not a kernel. Mea culpa.
Reported by: Mark Millard X-MFC-with: r355759
show more ...
|
| #
0269ae4c
|
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
| #
0bb30b3a
|
| 15-May-2019 |
Johannes Lundberg <johalun@FreeBSD.org> |
LinuxKPI: Move {lower|upper}_32_bits macros from port to base.
This patch is part of D19565
Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week
|
| #
33fa585a
|
| 17-Aug-2025 |
Jean-Sébastien Pédron <dumbbell@FreeBSD.org> |
linuxkpi: Split <linux/compiler.h>
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 sec
linuxkpi: Split <linux/compiler.h>
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.
Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54495
show more ...
|
| #
0a4b11dd
|
| 11-Oct-2025 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: add __counted_by_le() and __counted_by_be()
The former is needed by a wireless driver at v6.17.
MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.free
LinuxKPI: add __counted_by_le() and __counted_by_be()
The former is needed by a wireless driver at v6.17.
MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D53203
show more ...
|
| #
ff5bcb74
|
| 18-Aug-2025 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
LinuxKPI: add __struct_size
Use __builtin_object_size() by default. If __builtin_dynamic_object_size() is available use that instead.
I would hope that in a future version we can remove the conditi
LinuxKPI: add __struct_size
Use __builtin_object_size() by default. If __builtin_dynamic_object_size() is available use that instead.
I would hope that in a future version we can remove the conditional checks but in order to be able to MFC this without checking all compiler versions simply keep it this way for now.
Sponsored by: The FreeBSD Foundation (initially) MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52077
show more ...
|