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;
49mod irq_binding;
50pub mod mmio;
51#[cfg(any(
52    feature = "block",
53    feature = "display",
54    feature = "input",
55    feature = "net",
56    feature = "usb",
57    feature = "vsock"
58))]
59mod registration;
60
61#[cfg(feature = "block")]
62pub mod block;
63#[cfg(feature = "display")]
64pub mod display;
65#[cfg(feature = "input")]
66pub mod input;
67#[cfg(feature = "net")]
68pub mod net;
69#[cfg(feature = "vsock")]
70pub mod vsock;
71
72#[cfg(feature = "jpeg")]
73pub mod jpeg;
74#[cfg(feature = "pci")]
75pub mod pci;
76#[cfg(feature = "rk3588-pwm")]
77pub mod pwm;
78#[cfg(feature = "rga")]
79pub mod rga;
80#[cfg(feature = "rknpu")]
81pub mod rknpu;
82#[cfg(feature = "serial")]
83pub mod serial;
84#[cfg(any(
85    feature = "rockchip-soc",
86    feature = "rockchip-pm",
87    feature = "rockchip-dwmmc",
88    feature = "starfive-soc"
89))]
90pub mod soc;
91#[cfg(feature = "rtc")]
92pub mod time;
93#[cfg(feature = "usb")]
94pub mod usb;
95#[cfg(virtio_dev)]
96pub mod virtio;
97
98#[cfg(feature = "pci")]
99pub use binding_info::PciIrqRequirement;
100pub use binding_info::{BindingInfo, BindingIrq, BindingIrqBinding, BindingIrqSource, FdtIrqSpec};
101#[cfg(feature = "pci")]
102pub use binding_resolver::binding_info_from_pci;
103pub use binding_resolver::{
104    binding_info_from_acpi, binding_info_from_acpi_route, binding_info_from_fdt,
105    binding_irq_from_named_fdt_interrupt,
106};
107pub use error::{Error, Result};
108pub use irq_binding::IrqBindingLease;