File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66// This requires the Rust's new/future `v0` mangling scheme because the default
77// one ("legacy") uses invalid characters for C identifiers (thus we cannot use
88// the `EXPORT_SYMBOL_*` macros).
9+ //
10+ // All symbols are exported as GPL-only to guarantee no GPL-only feature is
11+ // accidentally exposed.
912
1013#include <linux/module.h>
1114
Original file line number Diff line number Diff line change 11// 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-only to guarantee no GPL-only feature is
18+ // accidentally exposed.
219
320#include <linux/bug.h>
421#include <linux/build_bug.h>
You can’t perform that action at this time.
0 commit comments