File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 6
6
// This requires the Rust's new/future `v0` mangling scheme because the default
7
7
// one ("legacy") uses invalid characters for C identifiers (thus we cannot use
8
8
// the `EXPORT_SYMBOL_*` macros).
9
+ //
10
+ // All symbols are exported as GPL to guarantee no GPL-only feature is
11
+ // accidentally exposed.
9
12
10
13
#include <linux/module.h>
11
14
Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: GPL-2.0
2
+ //
3
+ // Non-trivial C macros cannot be used in Rust. Similarly, inlined C functions
4
+ // cannot be called either. This file explicitly creates functions ("helpers")
5
+ // that wrap those so that they can be called from Rust.
6
+ //
7
+ // Even though Rust kernel modules should never use directly the bindings, some
8
+ // of these helpers need to be exported because Rust generics and inlined
9
+ // functions may not get their code generated in the crate where they are
10
+ // defined. Other helpers, called from non-inline functions, may not be
11
+ // exported, in principle. However, in general, the Rust compiler does not
12
+ // guarantee codegen will be performed for a non-inline function either.
13
+ // Therefore, this file exports all the helpers. In the future, this may be
14
+ // revisited to reduce the number of exports after the compiler is informed
15
+ // about the places codegen is required.
16
+ //
17
+ // All symbols are exported as GPL to guarantee no GPL-only feature is
18
+ // accidentally exposed.
2
19
3
20
#include <linux/bug.h>
4
21
#include <linux/build_bug.h>
You can’t perform that action at this time.
0 commit comments