Skip to main content

page/
lib.rs

1// Copyright 2026 The Fuchsia Authors
2//
3// Use of this source code is governed by a MIT-style
4// license that can be found in the LICENSE file or at
5// https://opensource.org/licenses/MIT
6
7#![no_std]
8
9// TODO(https://fxbug.dev/534566390): Extend this to support more generic page definitions. For now
10// since the C++ side only supports 4k pages we can hard code the 4k constants here.
11
12/// The selected page size.
13pub const SIZE: usize = 4096;
14
15/// The shift of the first level of virtual address mask used for page table walking.
16pub const SHIFT: usize = 12;
17
18/// Mask that will extract the offset into a page of an address.
19pub const MASK: usize = 4095;