xref: /linux/rust/bindgen_parameters (revision efe86f088f48f18c27b648e5724048947f3b7fb4)
12f7ab126SMiguel Ojeda# SPDX-License-Identifier: GPL-2.0
22f7ab126SMiguel Ojeda
32fd6f55cSGary Guo# We want to map these types to `isize`/`usize` manually, instead of
42fd6f55cSGary Guo# define them as `int`/`long` depending on platform bitwidth.
52fd6f55cSGary Guo--blocklist-type __kernel_s?size_t
62fd6f55cSGary Guo--blocklist-type __kernel_ptrdiff_t
72fd6f55cSGary Guo
82f7ab126SMiguel Ojeda--opaque-type xregs_state
92f7ab126SMiguel Ojeda--opaque-type desc_struct
102f7ab126SMiguel Ojeda--opaque-type arch_lbr_state
112f7ab126SMiguel Ojeda--opaque-type local_apic
122f7ab126SMiguel Ojeda
132f7ab126SMiguel Ojeda# Packed type cannot transitively contain a `#[repr(align)]` type.
143098cb65SArnaldo Carvalho de Melo--opaque-type alt_instr
152f7ab126SMiguel Ojeda--opaque-type x86_msi_data
162f7ab126SMiguel Ojeda--opaque-type x86_msi_addr_lo
17*fc1118cdSJan Polensky# s390-only: same packed/align issue as above (E0588).
18*fc1118cdSJan Polensky--opaque-type lowcore
19*fc1118cdSJan Polensky--opaque-type tod_clock
20*fc1118cdSJan Polensky--opaque-type tpi_info
21*fc1118cdSJan Polensky--opaque-type uv_cb.*
22*fc1118cdSJan Polensky--opaque-type uv_secret.*
23*fc1118cdSJan Polensky--opaque-type zpci_fib
242f7ab126SMiguel Ojeda
252f7ab126SMiguel Ojeda# If SMP is disabled, `arch_spinlock_t` is defined as a ZST which triggers a Rust
262f7ab126SMiguel Ojeda# warning. We don't need to peek into it anyway.
272f7ab126SMiguel Ojeda--opaque-type spinlock
282f7ab126SMiguel Ojeda
299e5946deSAlice Ryhl# enums that appear in indirect function calls should specify a cfi type
309e5946deSAlice Ryhl--newtype-enum lru_status
319e5946deSAlice Ryhl--with-attribute-custom-enum=lru_status='#[cfi_encoding="10lru_status"]'
329e5946deSAlice Ryhl
332f7ab126SMiguel Ojeda# `seccomp`'s comment gets understood as a doctest
342f7ab126SMiguel Ojeda--no-doc-comments
35bad098d7SMatthew Maurer
36bad098d7SMatthew Maurer# These functions use the `__preserve_most` calling convention, which neither bindgen
37bad098d7SMatthew Maurer# nor Rust currently understand, and which Clang currently declares to be unstable.
38bad098d7SMatthew Maurer--blocklist-function __list_.*_report
39732cd686SGary Guo
40732cd686SGary Guo# These constants are sometimes not recognized by bindgen depending on config.
41732cd686SGary Guo# We use const helpers to aid bindgen, to avoid conflicts when constants are
42732cd686SGary Guo# recognized, block generation of the non-helper constants.
43732cd686SGary Guo--blocklist-item ARCH_SLAB_MINALIGN
448efe8816SDanilo Krummrich--blocklist-item ARCH_KMALLOC_MINALIGN
452b6a3f06SLorenzo Stoakes--blocklist-item VM_MERGEABLE
462b6a3f06SLorenzo Stoakes--blocklist-item VM_READ
472b6a3f06SLorenzo Stoakes--blocklist-item VM_WRITE
482b6a3f06SLorenzo Stoakes--blocklist-item VM_EXEC
492b6a3f06SLorenzo Stoakes--blocklist-item VM_SHARED
502b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYREAD
512b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYWRITE
522b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYEXEC
532b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYEXEC
542b6a3f06SLorenzo Stoakes--blocklist-item VM_PFNMAP
552b6a3f06SLorenzo Stoakes--blocklist-item VM_IO
562b6a3f06SLorenzo Stoakes--blocklist-item VM_DONTCOPY
572b6a3f06SLorenzo Stoakes--blocklist-item VM_DONTEXPAND
582b6a3f06SLorenzo Stoakes--blocklist-item VM_LOCKONFAULT
592b6a3f06SLorenzo Stoakes--blocklist-item VM_ACCOUNT
602b6a3f06SLorenzo Stoakes--blocklist-item VM_NORESERVE
612b6a3f06SLorenzo Stoakes--blocklist-item VM_HUGETLB
622b6a3f06SLorenzo Stoakes--blocklist-item VM_SYNC
632b6a3f06SLorenzo Stoakes--blocklist-item VM_ARCH_1
642b6a3f06SLorenzo Stoakes--blocklist-item VM_WIPEONFORK
652b6a3f06SLorenzo Stoakes--blocklist-item VM_DONTDUMP
662b6a3f06SLorenzo Stoakes--blocklist-item VM_SOFTDIRTY
672b6a3f06SLorenzo Stoakes--blocklist-item VM_MIXEDMAP
682b6a3f06SLorenzo Stoakes--blocklist-item VM_HUGEPAGE
692b6a3f06SLorenzo Stoakes--blocklist-item VM_NOHUGEPAGE
704846300bSBenno Lossin
714846300bSBenno Lossin# Structs should implement `Zeroable` when all of their fields do.
724846300bSBenno Lossin--with-derive-custom-struct .*=MaybeZeroable
734846300bSBenno Lossin--with-derive-custom-union .*=MaybeZeroable
74