try implement 02_module_params in rust
params: in module! macro don't exist yet
This commit is contained in:
parent
0d471911dd
commit
a407e656b6
4 changed files with 43 additions and 10 deletions
|
@ -1,24 +1,24 @@
|
|||
use kernel::prelude::*;
|
||||
|
||||
module! {
|
||||
type: RustOutOfTree,
|
||||
name: "test_module",
|
||||
type: BasicModule,
|
||||
name: "basic_module",
|
||||
author: "Florian RICHER <florian.richer@protonmail.com>",
|
||||
description: "Un module noyau qui affiche un message",
|
||||
license: "GPL",
|
||||
}
|
||||
|
||||
struct RustOutOfTree;
|
||||
struct BasicModule;
|
||||
|
||||
impl kernel::Module for RustOutOfTree {
|
||||
impl kernel::Module for BasicModule {
|
||||
fn init(_module: &'static ThisModule) -> Result<Self> {
|
||||
pr_info!("Bonjour! Le module est chargé.\n");
|
||||
|
||||
Ok(RustOutOfTree)
|
||||
Ok(BasicModule)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for RustOutOfTree {
|
||||
impl Drop for BasicModule {
|
||||
fn drop(&mut self) {
|
||||
pr_info!("Au revoir! Le module est déchargé.\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue