Compare commits

...

11 Commits

Author SHA1 Message Date
358c1104dc compatibility: updated module declaration 2023-04-09 23:37:43 +10:00
Miguel Ojeda
c8ed25d081 README: update with website
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-03-08 15:45:04 +01:00
Miguel Ojeda
885d229c0d README: use docs.kernel.org link
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-03-08 15:45:04 +01:00
Miguel Ojeda
a7f73938f8 Be consistent in $PWD use
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-02-05 02:16:11 +01:00
Miguel Ojeda
2f962a6247 Temporarily clarify that a patch is still required
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-02-05 02:15:07 +01:00
Miguel Ojeda
490d67b427
Merge pull request #4 from thepacketgeek/generate-rust-project
Adding section about rust-analyzer in README
2023-01-24 20:59:12 +01:00
Mat Wood
5081c8d082 Adding section about rust-analyzer in README
- Including an example of how to create a rust-analyzer `rust-project.json` config
- Adding `rust-project.json` to `.gitignore`

Signed-off-by: Matthew Wood <mat@thepacketgeek.com>
2023-01-24 11:29:56 -08:00
Miguel Ojeda
f44f83f3de
Merge pull request #5 from rnestler/fix-build-for-linux-6.2
Update for Linux 6.2
2023-01-24 19:24:19 +01:00
Raphael Nestler
e36fc14c01 Update for Linux 6.2
Signed-off-by: Raphael Nestler <raphael.nestler@gmail.com>
2023-01-24 15:22:41 +01:00
Miguel Ojeda
a5de4e66ae
Merge pull request #3 from rnestler/fix-build-for-linux-6.1
Fix build for Linux 6.1
2023-01-21 13:02:19 +01:00
Raphael Nestler
2fcc7219e4 Fix build for Linux 6.1 2022-12-18 20:47:44 +01:00
3 changed files with 16 additions and 7 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
*.rmeta
Module.symvers
modules.order
rust-project.json

View File

@ -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
```

View File

@ -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();