Skip to content

Commit 088e13c

Browse files
committed
MISSING SIGNOFFS: rust: Add PAGE_SIZE constant to kernel crate
Computed based on the PAGE_SHIFT macro from C. // Co-authored-by: Adam Bratschi-Kaye <[email protected]> // Co-authored-by: Miguel Ojeda <[email protected]> // Signed-off-by: Asahi Lina <[email protected]>
1 parent 25fc074 commit 088e13c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/kernel/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ pub(crate) mod private {
6161
pub trait Sealed {}
6262
}
6363

64+
/// Page size defined in terms of the `PAGE_SHIFT` macro from C.
65+
///
66+
/// [`PAGE_SHIFT`]: ../../../include/asm-generic/page.h
67+
pub const PAGE_SIZE: usize = 1 << bindings::PAGE_SHIFT;
68+
6469
/// Prefix to appear before log messages printed from within the `kernel` crate.
6570
const __LOG_PREFIX: &[u8] = b"rust_kernel\0";
6671

0 commit comments

Comments
 (0)