xref: /linux/rust/bindgen_parameters (revision 0fc8f6200d2313278fbf4539bbab74677c685531)
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
172f7ab126SMiguel Ojeda
182f7ab126SMiguel Ojeda# If SMP is disabled, `arch_spinlock_t` is defined as a ZST which triggers a Rust
192f7ab126SMiguel Ojeda# warning. We don't need to peek into it anyway.
202f7ab126SMiguel Ojeda--opaque-type spinlock
212f7ab126SMiguel Ojeda
22*9e5946deSAlice Ryhl# enums that appear in indirect function calls should specify a cfi type
23*9e5946deSAlice Ryhl--newtype-enum lru_status
24*9e5946deSAlice Ryhl--with-attribute-custom-enum=lru_status='#[cfi_encoding="10lru_status"]'
25*9e5946deSAlice Ryhl
262f7ab126SMiguel Ojeda# `seccomp`'s comment gets understood as a doctest
272f7ab126SMiguel Ojeda--no-doc-comments
28bad098d7SMatthew Maurer
29bad098d7SMatthew Maurer# These functions use the `__preserve_most` calling convention, which neither bindgen
30bad098d7SMatthew Maurer# nor Rust currently understand, and which Clang currently declares to be unstable.
31bad098d7SMatthew Maurer--blocklist-function __list_.*_report
32732cd686SGary Guo
33732cd686SGary Guo# These constants are sometimes not recognized by bindgen depending on config.
34732cd686SGary Guo# We use const helpers to aid bindgen, to avoid conflicts when constants are
35732cd686SGary Guo# recognized, block generation of the non-helper constants.
36732cd686SGary Guo--blocklist-item ARCH_SLAB_MINALIGN
378efe8816SDanilo Krummrich--blocklist-item ARCH_KMALLOC_MINALIGN
382b6a3f06SLorenzo Stoakes--blocklist-item VM_MERGEABLE
392b6a3f06SLorenzo Stoakes--blocklist-item VM_READ
402b6a3f06SLorenzo Stoakes--blocklist-item VM_WRITE
412b6a3f06SLorenzo Stoakes--blocklist-item VM_EXEC
422b6a3f06SLorenzo Stoakes--blocklist-item VM_SHARED
432b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYREAD
442b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYWRITE
452b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYEXEC
462b6a3f06SLorenzo Stoakes--blocklist-item VM_MAYEXEC
472b6a3f06SLorenzo Stoakes--blocklist-item VM_PFNMAP
482b6a3f06SLorenzo Stoakes--blocklist-item VM_IO
492b6a3f06SLorenzo Stoakes--blocklist-item VM_DONTCOPY
502b6a3f06SLorenzo Stoakes--blocklist-item VM_DONTEXPAND
512b6a3f06SLorenzo Stoakes--blocklist-item VM_LOCKONFAULT
522b6a3f06SLorenzo Stoakes--blocklist-item VM_ACCOUNT
532b6a3f06SLorenzo Stoakes--blocklist-item VM_NORESERVE
542b6a3f06SLorenzo Stoakes--blocklist-item VM_HUGETLB
552b6a3f06SLorenzo Stoakes--blocklist-item VM_SYNC
562b6a3f06SLorenzo Stoakes--blocklist-item VM_ARCH_1
572b6a3f06SLorenzo Stoakes--blocklist-item VM_WIPEONFORK
582b6a3f06SLorenzo Stoakes--blocklist-item VM_DONTDUMP
592b6a3f06SLorenzo Stoakes--blocklist-item VM_SOFTDIRTY
602b6a3f06SLorenzo Stoakes--blocklist-item VM_MIXEDMAP
612b6a3f06SLorenzo Stoakes--blocklist-item VM_HUGEPAGE
622b6a3f06SLorenzo Stoakes--blocklist-item VM_NOHUGEPAGE
634846300bSBenno Lossin
644846300bSBenno Lossin# Structs should implement `Zeroable` when all of their fields do.
654846300bSBenno Lossin--with-derive-custom-struct .*=MaybeZeroable
664846300bSBenno Lossin--with-derive-custom-union .*=MaybeZeroable
67