-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1275 from hermit-os/virtio-fs-config
refactor(virtio-spec): migrate `FsDevCfgRaw` to virtio-spec
- Loading branch information
Showing
4 changed files
with
59 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! File System Device | ||
|
||
use volatile::access::ReadOnly; | ||
use volatile_macro::VolatileFieldAccess; | ||
|
||
pub use super::features::fs::F; | ||
use super::le32; | ||
|
||
/// Device configuration | ||
#[doc(alias = "virtio_fs_config")] | ||
#[cfg_attr( | ||
feature = "zerocopy", | ||
derive(zerocopy_derive::FromZeroes, zerocopy_derive::FromBytes) | ||
)] | ||
#[derive(VolatileFieldAccess)] | ||
#[repr(C)] | ||
pub struct Config { | ||
/// This is the name associated with this file system. The tag is | ||
/// encoded in UTF-8 and padded with NUL bytes if shorter than the | ||
/// available space. This field is not NUL-terminated if the encoded bytes | ||
/// take up the entire field. | ||
#[access(ReadOnly)] | ||
tag: [u8; 36], | ||
|
||
/// This is the total number of request virtqueues | ||
/// exposed by the device. Each virtqueue offers identical functionality and | ||
/// there are no ordering guarantees between requests made available on | ||
/// different queues. Use of multiple queues is intended to increase | ||
/// performance. | ||
#[access(ReadOnly)] | ||
num_request_queues: le32, | ||
|
||
/// This is the minimum number of bytes required for each | ||
/// buffer in the notification queue. | ||
#[access(ReadOnly)] | ||
notify_buf_size: le32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters