Skip to main content

ax_driver/
lib.rs

1//! rdrive + rdif host driver registration collection.
2
3#![no_std]
4#![feature(used_with_arg)]
5
6extern crate alloc;
7
8pub use rdrive::{DriverGeneric, IrqId, KError, PlatformDevice, ProbeError, probe, register};
9#[doc(hidden)]
10pub use rdrive_macros::__mod_maker;
11
12#[macro_export]
13macro_rules! model_register {
14    (
15        $($i:ident : $t:expr),+,
16    ) => {
17        $crate::__mod_maker! {
18            pub mod some {
19                #[allow(unused_imports)]
20                use super::*;
21                use $crate::register::*;
22
23                /// Static instance of driver registration information.
24                ///
25                /// This static variable is placed in the `.driver.register` linker section
26                /// so that the driver manager can automatically discover and load it during
27                /// system startup.
28                #[unsafe(link_section = ".driver.register")]
29                #[unsafe(no_mangle)]
30                #[used(linker)]
31                pub static DRIVER: DriverRegister = DriverRegister {
32                    $($i : $t),+
33                };
34            }
35        }
36    };
37}
38
39model_register!(
40    name: "ax-driver macro placeholder",
41    level: ProbeLevel::PostKernel,
42    priority: ProbePriority::DEFAULT,
43    probe_kinds: &[],
44);
45
46mod binding_info;
47mod binding_resolver;
48pub mod error;
49pub mod mmio;
50#[cfg(any(
51    feature = "block",
52    feature = "display",
53    feature = "input",
54    feature = "net",
55    feature = "usb",
56    feature = "vsock"
57))]
58mod registration;
59
60#[cfg(feature = "block")]
61pub mod block;
62#[cfg(feature = "display")]
63pub mod display;
64#[cfg(feature = "input")]
65pub mod input;
66#[cfg(feature = "net")]
67pub mod net;
68#[cfg(feature = "vsock")]
69pub mod vsock;
70
71#[cfg(feature = "jpeg")]
72pub mod jpeg;
73#[cfg(feature = "pci")]
74pub mod pci;
75#[cfg(feature = "rk3588-pwm")]
76pub mod pwm;
77#[cfg(feature = "rga")]
78pub mod rga;
79#[cfg(feature = "rknpu")]
80pub mod rknpu;
81#[cfg(feature = "serial")]
82pub mod serial;
83#[cfg(any(
84    feature = "rockchip-soc",
85    feature = "rockchip-pm",
86    feature = "rockchip-dwmmc",
87    feature = "starfive-soc"
88))]
89pub mod soc;
90#[cfg(feature = "rtc")]
91pub mod time;
92#[cfg(feature = "usb")]
93pub mod usb;
94#[cfg(virtio_dev)]
95pub mod virtio;
96
97#[cfg(feature = "pci")]
98pub use binding_info::PciIrqRequirement;
99pub use binding_info::{BindingInfo, BindingIrq, BindingIrqBinding, BindingIrqSource, FdtIrqSpec};
100#[cfg(feature = "pci")]
101pub use binding_resolver::binding_info_from_pci;
102pub use binding_resolver::{
103    binding_info_from_acpi, binding_info_from_acpi_route, binding_info_from_fdt,
104    binding_irq_from_named_fdt_interrupt,
105};
106pub use error::{Error, Result};