Add constants for sizes

This commit is contained in:
Jeremy Soller
2020-09-06 21:06:12 -06:00
parent 4bf43652c3
commit 2dc0853903
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -6,6 +6,7 @@ use core::{
use std::collections::BTreeMap;
use crate::{
MEGABYTE,
Arch,
MemoryArea,
PageEntry,
@@ -94,7 +95,6 @@ impl Arch for EmulateArch {
}
}
const MEGABYTE: usize = 1024 * 1024;
const MEMORY_SIZE: usize = 64 * MEGABYTE;
static MEMORY_AREAS: [MemoryArea; 1] = [
MemoryArea {
+5
View File
@@ -12,6 +12,11 @@ pub use crate::{
mod arch;
mod page;
pub const KILOBYTE: usize = 1024;
pub const MEGABYTE: usize = KILOBYTE * KILOBYTE;
pub const GIGABYTE: usize = KILOBYTE * MEGABYTE;
pub const TERABYTE: usize = KILOBYTE * GIGABYTE;
// Physical memory address
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[repr(transparent)]