| 1 | |
| 2 | |
| 3 | * A hack to export Rust symbols for loadable modules without having to redo
|
| 4 | * the entire `include/linux/export.h` logic in Rust.
|
| 5 | *
|
| 6 | * This requires Rust's new/future `v0` mangling scheme because the default one
|
| 7 | * ("legacy") uses invalid characters for C identifiers (thus we cannot use the
|
| 8 | * `EXPORT_SYMBOL_*` macros).
|
| 9 | *
|
| 10 | * All symbols are exported as GPL-only to guarantee no GPL-only feature is
|
| 11 | * accidentally exposed.
|
| 12 |
|
| 13 |
|
| 14 | #include <linux/export.h>
|
| 15 |
|
| 16 | #define EXPORT_SYMBOL_RUST_GPL(sym) extern int sym; EXPORT_SYMBOL_GPL(sym)
|
| 17 |
|
| 18 | #include "exports_core_generated.h"
|
| 19 | #include "exports_bindings_generated.h"
|
| 20 | #include "exports_kernel_generated.h"
|
| 21 |
|
| 22 | #ifndef CONFIG_RUST_INLINE_HELPERS
|
| 23 | #include "exports_helpers_generated.h"
|
| 24 | #endif
|
| 25 |
|
| 26 | |
| 27 | #ifdef CONFIG_RUST_BUILD_ASSERT_ALLOW
|
| 28 | EXPORT_SYMBOL_RUST_GPL(rust_build_error);
|
| 29 | #endif
|