Macro kernel::module_misc_device
source · [−]macro_rules! module_misc_device {
(type: $type:ty, $($f:tt)*) => { ... };
}
Expand description
Declares a kernel module that exposes a single misc device.
The type
argument should be a type which implements the FileOpener
trait. Also accepts
various forms of kernel metadata.
C header: include/linux/moduleparam.h
Examples
ⓘ
use kernel::prelude::*;
module_misc_device! {
type: MyFile,
name: "my_miscdev_kernel_module",
author: "Rust for Linux Contributors",
description: "My very own misc device kernel module!",
license: "GPL",
}
#[derive(Default)]
struct MyFile;
#[vtable]
impl kernel::file::Operations for MyFile {}