Skip to content

Commit

Permalink
[api] Re-export ArceOS modules in arceos_api, update app test
Browse files Browse the repository at this point in the history
  • Loading branch information
equation314 committed Jul 30, 2024
1 parent ee0d7a3 commit 1ee6dd4
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
env:
qemu-version: 8.2.0
rust-toolchain: nightly-2024-05-02
arceos-apps: b36b9d5
arceos-apps: c01cd92

jobs:
unit-test:
Expand Down
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions api/arceos_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ default = []

irq = ["axfeat/irq"]
alloc = ["dep:axalloc", "axfeat/alloc"]
multitask = ["axtask/multitask", "axfeat/multitask"]
fs = ["dep:axfs", "axfeat/fs"]
net = ["dep:axnet", "axfeat/net"]
display = ["dep:axdisplay", "axfeat/display"]
paging = ["dep:axmm", "axfeat/paging"]
multitask = ["axtask/multitask", "axsync/multitask", "axfeat/multitask"]
fs = ["dep:axfs", "dep:axdriver", "axfeat/fs"]
net = ["dep:axnet", "dep:axdriver", "axfeat/net"]
display = ["dep:axdisplay", "dep:axdriver", "axfeat/display"]

myfs = ["axfeat/myfs"]

Expand All @@ -32,8 +33,11 @@ axruntime = { workspace = true }
axconfig = { workspace = true }
axlog = { workspace = true }
axhal = { workspace = true }
axsync = { workspace = true }
axalloc = { workspace = true, optional = true }
axmm = { workspace = true, optional = true }
axtask = { workspace = true, optional = true }
axdriver = { workspace = true, optional = true }
axfs = { workspace = true, optional = true }
axnet = { workspace = true, optional = true }
axdisplay = { workspace = true, optional = true }
25 changes: 24 additions & 1 deletion api/arceos_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
feature = "dummy-if-not-enabled"
))]
extern crate alloc;
extern crate axruntime;

#[macro_use]
mod macros;
Expand Down Expand Up @@ -339,3 +338,27 @@ pub mod io {
pub type AxPollState;
}
}

/// Re-exports of ArceOS modules.
pub mod modules {
pub use axconfig;
pub use axhal;
pub use axlog;
pub use axruntime;
pub use axsync;

#[cfg(feature = "alloc")]
pub use axalloc;
#[cfg(feature = "display")]
pub use axdisplay;
#[cfg(any(feature = "fs", feature = "net", feature = "display"))]
pub use axdriver;
#[cfg(feature = "fs")]
pub use axfs;
#[cfg(feature = "paging")]
pub use axmm;
#[cfg(feature = "net")]
pub use axnet;
#[cfg(feature = "multitask")]
pub use axtask;
}
1 change: 0 additions & 1 deletion modules/axhal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ lazyinit = "0.2"
percpu = "0.1"
memory_addr = "0.2"
handler_table = "0.1"
crate_interface = "0.1"
page_table_entry = "0.3"
page_table_multiarch = { version = "0.3", optional = true }
axlog = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions ulib/axstd/src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/// ArceOS-specific definitions.
pub mod arceos {
pub use arceos_api as api;
#[doc(no_inline)]
pub use arceos_api::modules;
}

0 comments on commit 1ee6dd4

Please sign in to comment.