Compare commits
11 Commits
427f696b5d
...
358c1104dc
| Author | SHA1 | Date | |
|---|---|---|---|
| 358c1104dc | |||
|
|
c8ed25d081 | ||
|
|
885d229c0d | ||
|
|
a7f73938f8 | ||
|
|
2f962a6247 | ||
|
|
490d67b427 | ||
|
|
5081c8d082 | ||
|
|
f44f83f3de | ||
|
|
e36fc14c01 | ||
|
|
a5de4e66ae | ||
|
|
2fcc7219e4 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
||||
*.rmeta
|
||||
Module.symvers
|
||||
modules.order
|
||||
rust-project.json
|
||||
|
||||
12
README.md
12
README.md
@ -31,6 +31,14 @@ make[1]: Leaving directory '.../linux-with-rust-support'
|
||||
[ 1.085944] rust_out_of_tree: Rust out-of-tree sample (exit)
|
||||
```
|
||||
|
||||
For details about the Rust support, see https://github.com/Rust-for-Linux/linux.
|
||||
For details about the Rust support, see https://rust-for-linux.com.
|
||||
|
||||
For details about out-of-tree modules, see https://www.kernel.org/doc/html/latest/kbuild/modules.html.
|
||||
For details about out-of-tree modules, see https://docs.kernel.org/kbuild/modules.html.
|
||||
|
||||
## rust-analyzer
|
||||
|
||||
Rust for Linux (with https://lore.kernel.org/rust-for-linux/20230121052507.885734-1-varmavinaym@gmail.com/ applied) supports building a `rust-project.json` configuration for [`rust-analyzer`](https://rust-analyzer.github.io/), including for out-of-tree modules:
|
||||
|
||||
```sh
|
||||
make -C .../linux-with-rust-support M=$PWD rust-analyzer
|
||||
```
|
||||
@ -6,10 +6,10 @@ use kernel::prelude::*;
|
||||
|
||||
module! {
|
||||
type: RustOutOfTree,
|
||||
name: "rust_out_of_tree",
|
||||
author: "Rust for Linux Contributors",
|
||||
description: "Rust out-of-tree sample",
|
||||
license: "GPL",
|
||||
name: b"rust_out_of_tree",
|
||||
author: b"Rust for Linux Contributors",
|
||||
description: b"Rust out-of-tree sample",
|
||||
license: b"GPL",
|
||||
}
|
||||
|
||||
struct RustOutOfTree {
|
||||
@ -17,7 +17,7 @@ struct RustOutOfTree {
|
||||
}
|
||||
|
||||
impl kernel::Module for RustOutOfTree {
|
||||
fn init(_name: &'static CStr, _module: &'static ThisModule) -> Result<Self> {
|
||||
fn init(_module: &'static ThisModule) -> Result<Self> {
|
||||
pr_info!("Rust out-of-tree sample (init)\n");
|
||||
|
||||
let mut numbers = Vec::new();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user