-
Notifications
You must be signed in to change notification settings - Fork 378
[feat] Enhance dyn driver #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
||
#[allow(unused)] | ||
/// maps a mmio physical address to a virtual address. | ||
fn iomap(addr: PhysAddr, size: usize) -> Result<NonNull<u8>, Box<dyn Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why return Box<dyn Error>
as error type?
Maybe you just return a string? Can we return AxError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnProbeError
uses Box<dyn Error>
, these two error type are in other crates, if we want to use ?
to convert err, need to create new type to warp a String or AxError,and boxed error has more err msg than AxError
, make it easier to find error location.
This PR is scheduled to be included in the next release window (0.3.0, expected 9/30), and PRs marked 0.2.0 will be processed first. |
[fix] 优化错误处理格式,简化 MMIO 区域映射失败的错误信息 feat(axdriver): update rdrive dependency and add block driver support - Updated rdrive dependency version from 0.14 to 0.14.4 in Cargo.toml. - Introduced a new block driver module with implementations for block operations. - Added virtio block driver support with MMIO transport. - Refactored interrupt controller (GIC) driver probes to use OnProbeError for error handling. - Enhanced dynamic driver probing to include block devices when the "block" feature is enabled. - Improved error handling in block driver operations by mapping errors between driver and I/O layers.
feat(axdriver):
downcast
, which allows converting aClass
driver to a specific type. For example,Device<Intc>.downcast -> Device<Gicv3>
.test cmd: