Skip to content

Commit add18b7

Browse files
hoshinolinajannau
authored andcommitted
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 <ark.email@gmail.com> // Co-authored-by: Miguel Ojeda <ojeda@kernel.org> // Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent cfe4d41 commit add18b7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

rust/kernel/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ pub(crate) mod private {
9999
pub trait Sealed {}
100100
}
101101

102+
/// Page size defined in terms of the `PAGE_SHIFT` macro from C.
103+
///
104+
/// [`PAGE_SHIFT`]: ../../../include/asm-generic/page.h
105+
pub const PAGE_SIZE: usize = 1 << bindings::PAGE_SHIFT;
106+
102107
/// Prefix to appear before log messages printed from within the `kernel` crate.
103108
const __LOG_PREFIX: &[u8] = b"rust_kernel\0";
104109

0 commit comments

Comments
 (0)