diff options
author | Andreas Hindborg <a.hindborg@samsung.com> | 2023-08-28 14:55:37 +0200 |
---|---|---|
committer | Danilo Krummrich <dakr@redhat.com> | 2023-11-22 22:00:54 +0100 |
commit | a19ee862eca76a1727c81310eb9074872d4a6691 (patch) | |
tree | 08a4624e3960072629468830e9dd200e234665b5 /rust/kernel/lib.rs | |
parent | 075c18a346a2008f46972ded41c23c85dda9304a (diff) |
rust: add driver abstraction
Based on driver.rs from https://github.com/Rust-for-Linux/linux/commit/3f893e11f62f880f6d4e2bf6cda199a4366203a7
Diffstat (limited to 'rust/kernel/lib.rs')
-rw-r--r-- | rust/kernel/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index fe4216b89b69..c0c617ab0601 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -14,6 +14,8 @@ #![no_std] #![feature(allocator_api)] #![feature(coerce_unsized)] +#![feature(const_refs_to_cell)] +#![feature(const_trait_impl)] #![feature(dispatch_from_dyn)] #![feature(new_uninit)] #![feature(receiver_trait)] @@ -32,6 +34,7 @@ extern crate self as kernel; mod allocator; mod build_assert; pub mod device; +pub mod driver; pub mod error; pub mod init; pub mod ioctl; @@ -74,7 +77,7 @@ pub trait Module: Sized + Sync { /// should do. /// /// Equivalent to the `module_init` macro in the C API. - fn init(module: &'static ThisModule) -> error::Result<Self>; + fn init(name: &'static str::CStr, module: &'static ThisModule) -> error::Result<Self>; } /// Equivalent to `THIS_MODULE` in the C API. |