]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gcc/extensions-to-the-c-language-family/declaring-attributes-of-functions/bpf-function-attributes.rst
sphinx: copy files from texi2rst-generated repository
[thirdparty/gcc.git] / gcc / doc / gcc / extensions-to-the-c-language-family / declaring-attributes-of-functions / bpf-function-attributes.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _bpf-function-attributes:
7
8 BPF Function Attributes
9 ^^^^^^^^^^^^^^^^^^^^^^^
10
11 These function attributes are supported by the BPF back end:
12
13 .. index:: kernel helper, function attribute, BPF
14
15 .. bpf-fn-attr:: kernel_helper
16
17 use this attribute to indicate the specified function declaration is a
18 kernel helper. The helper function is passed as an argument to the
19 attribute. Example:
20
21 .. code-block:: c++
22
23 int bpf_probe_read (void *dst, int size, const void *unsafe_ptr)
24 __attribute__ ((kernel_helper (4)));