diff options
| author | Bobby <[email protected]> | 2026-02-25 06:09:23 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-02-25 06:09:23 +0530 |
| commit | bd462bccea2a637486f863a6342b9870b35c69aa (patch) | |
| tree | c68dc848542f53b701c553bd0124874948598c8d /common/constants/memory/sizes.zig | |
| parent | 313ab7ea7d5a5d902005d8543ab6b323ed948048 (diff) | |
| download | akiba-bd462bccea2a637486f863a6342b9870b35c69aa.tar.xz akiba-bd462bccea2a637486f863a6342b9870b35c69aa.zip | |
feat: Add common constants, errors, and serial driver functionality
Diffstat (limited to 'common/constants/memory/sizes.zig')
| -rw-r--r-- | common/constants/memory/sizes.zig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/constants/memory/sizes.zig b/common/constants/memory/sizes.zig new file mode 100644 index 0000000..049b087 --- /dev/null +++ b/common/constants/memory/sizes.zig @@ -0,0 +1,21 @@ +//! Memory Size Constants + +pub const page_size: u64 = 4096; +pub const page_shift: u6 = 12; +pub const page_mask: u64 = page_size - 1; + +pub const large_page_size: u64 = 2 * 1024 * 1024; +pub const large_page_shift: u6 = 21; +pub const large_page_mask: u64 = large_page_size - 1; + +pub const huge_page_size: u64 = 1024 * 1024 * 1024; +pub const huge_page_shift: u6 = 30; +pub const huge_page_mask: u64 = huge_page_size - 1; + +pub const kilobyte: u64 = 1024; +pub const megabyte: u64 = 1024 * kilobyte; +pub const gigabyte: u64 = 1024 * megabyte; +pub const terabyte: u64 = 1024 * gigabyte; + +pub const entries_per_page_table: u64 = 512; +pub const page_table_levels: u8 = 4; |
