Add constants for sizes
This commit is contained in:
+1
-1
@@ -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 {
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user