From 019ad4bab456bf107cba54dc8c396fbdd6d2bae0 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 29 Jun 2019 14:37:41 +0200 Subject: [PATCH] move constants to machine.rs --- src/lib.rs | 10 ++++------ src/machine.rs | 5 +++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 66b6afde331..0e4a9c4ccc3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,14 +37,12 @@ pub use crate::range_map::RangeMap; pub use crate::helpers::{EvalContextExt as HelpersEvalContextExt}; pub use crate::mono_hash_map::MonoHashMap; pub use crate::stacked_borrows::{EvalContextExt as StackedBorEvalContextExt, Tag, Permission, Stack, Stacks, Item}; -pub use crate::machine::{MemoryExtra, AllocExtra, MiriMemoryKind, Evaluator, MiriEvalContext, MiriEvalContextExt}; +pub use crate::machine::{ + PAGE_SIZE, STACK_ADDR, NUM_CPUS, + MemoryExtra, AllocExtra, MiriMemoryKind, Evaluator, MiriEvalContext, MiriEvalContextExt, +}; pub use crate::eval::{eval_main, create_ecx, MiriConfig}; -// Some global facts about the emulated machine. -pub const PAGE_SIZE: u64 = 4*1024; -pub const STACK_ADDR: u64 = 16*PAGE_SIZE; // not really about the "stack", but where we start assigning integer addresses to allocations -pub const NUM_CPUS: u64 = 1; - /// Insert rustc arguments at the beginning of the argument list that Miri wants to be /// set per default, for maximal validation power. pub fn miri_default_args() -> &'static [&'static str] { diff --git a/src/machine.rs b/src/machine.rs index eb177fa2a18..383b6aac631 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -12,6 +12,11 @@ use rustc::mir; use crate::*; +// Some global facts about the emulated machine. +pub const PAGE_SIZE: u64 = 4*1024; // FIXME: adjust to target architecture +pub const STACK_ADDR: u64 = 16*PAGE_SIZE; // not really about the "stack", but where we start assigning integer addresses to allocations +pub const NUM_CPUS: u64 = 1; + /// Extra memory kinds #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum MiriMemoryKind {