Skip to main content

ax_plat_riscv64_visionfive2/
lib.rs

1#![no_std]
2#![cfg(all(target_arch = "riscv64", target_os = "none"))]
3
4#[macro_use]
5extern crate log;
6#[macro_use]
7extern crate ax_plat;
8
9mod boot;
10mod console;
11mod drivers;
12mod init;
13#[cfg(feature = "irq")]
14mod irq;
15mod mem;
16mod power;
17mod time;
18
19pub mod config {
20    //! Platform configuration module.
21    //!
22    //! If the `AX_CONFIG_PATH` environment variable is set, it will load the configuration from the specified path.
23    //! Otherwise, it will fall back to the `axconfig.toml` file in the current directory and generate the default configuration.
24    //!
25    //! If the `PACKAGE` field in the configuration does not match the package name, it will panic with an error message.
26    ax_config_macros::include_configs!(path_env = "AX_CONFIG_PATH", fallback = "axconfig.toml");
27    assert_str_eq!(
28        PACKAGE,
29        env!("CARGO_PKG_NAME"),
30        "`PACKAGE` field in the configuration does not match the Package name. Please check your \
31         configuration file."
32    );
33}