Skip to content

Commit 4b2ee22

Browse files
author
Andreas Hindborg
committed
rust: block: add some constants
1 parent ec2ae6f commit 4b2ee22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

rust/kernel/block.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@
33
//! Types for working with the block layer.
44
55
pub mod mq;
6+
7+
/// Bit mask for masking out [`SECTOR_SIZE`]
8+
pub const SECTOR_MASK: u32 = bindings::SECTOR_MASK;
9+
10+
/// Sectors are size `1 << SECTOR_SHIFT`.
11+
pub const SECTOR_SHIFT: u32 = bindings::SECTOR_SHIFT;
12+
13+
/// Size of a sector.
14+
pub const SECTOR_SIZE: u32 = bindings::SECTOR_SIZE;
15+
16+
/// Power of two difference in size of a page and size of a sector.
17+
pub const PAGE_SECTORS_SHIFT: u32 = bindings::PAGE_SECTORS_SHIFT;

0 commit comments

Comments
 (0)