Compare commits
No commits in common. "358c1104dc9fb0cc23cd8d11bb6b498146b55152" and "427f696b5d6f0d2d53af0820161c0fd89c5c276c" have entirely different histories.
358c1104dc
...
427f696b5d
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,4 +8,3 @@
|
|||||||
*.rmeta
|
*.rmeta
|
||||||
Module.symvers
|
Module.symvers
|
||||||
modules.order
|
modules.order
|
||||||
rust-project.json
|
|
||||||
|
|||||||
12
README.md
12
README.md
@ -31,14 +31,6 @@ make[1]: Leaving directory '.../linux-with-rust-support'
|
|||||||
[ 1.085944] rust_out_of_tree: Rust out-of-tree sample (exit)
|
[ 1.085944] rust_out_of_tree: Rust out-of-tree sample (exit)
|
||||||
```
|
```
|
||||||
|
|
||||||
For details about the Rust support, see https://rust-for-linux.com.
|
For details about the Rust support, see https://github.com/Rust-for-Linux/linux.
|
||||||
|
|
||||||
For details about out-of-tree modules, see https://docs.kernel.org/kbuild/modules.html.
|
For details about out-of-tree modules, see https://www.kernel.org/doc/html/latest/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! {
|
module! {
|
||||||
type: RustOutOfTree,
|
type: RustOutOfTree,
|
||||||
name: b"rust_out_of_tree",
|
name: "rust_out_of_tree",
|
||||||
author: b"Rust for Linux Contributors",
|
author: "Rust for Linux Contributors",
|
||||||
description: b"Rust out-of-tree sample",
|
description: "Rust out-of-tree sample",
|
||||||
license: b"GPL",
|
license: "GPL",
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RustOutOfTree {
|
struct RustOutOfTree {
|
||||||
@ -17,7 +17,7 @@ struct RustOutOfTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl kernel::Module for RustOutOfTree {
|
impl kernel::Module for RustOutOfTree {
|
||||||
fn init(_module: &'static ThisModule) -> Result<Self> {
|
fn init(_name: &'static CStr, _module: &'static ThisModule) -> Result<Self> {
|
||||||
pr_info!("Rust out-of-tree sample (init)\n");
|
pr_info!("Rust out-of-tree sample (init)\n");
|
||||||
|
|
||||||
let mut numbers = Vec::new();
|
let mut numbers = Vec::new();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user