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 = "pci")]
72pub mod pci;
73#[cfg(feature = "rga")]
74pub mod rga;
75#[cfg(feature = "rknpu")]
76pub mod rknpu;
77#[cfg(feature = "serial")]
78pub mod serial;
79#[cfg(any(
80    feature = "rockchip-soc",
81    feature = "rockchip-pm",
82    feature = "sg2002-placeholder",
83    feature = "rockchip-dwmmc"
84))]
85pub mod soc;
86#[cfg(all(feature = "rtc", plat_dyn))]
87pub mod time;
88#[cfg(feature = "usb")]
89pub mod usb;
90#[cfg(virtio_dev)]
91pub mod virtio;
92
93pub use binding_info::BindingInfo;
94#[cfg(feature = "pci")]
95pub use binding_info::PciIrqRequirement;
96#[cfg(feature = "pci")]
97pub use binding_resolver::binding_info_from_pci;
98pub use binding_resolver::{
99    binding_info_from_acpi, binding_info_from_acpi_route, binding_info_from_fdt,
100};
101pub use error::{Error, Result};