From c389abc140d301d2c549ef26469035beb947581a Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Sat, 2 Jul 2022 23:17:33 -0700 Subject: [PATCH] other segments --- evm/src/memory/segments.rs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/evm/src/memory/segments.rs b/evm/src/memory/segments.rs index 2064da00..d20cb037 100644 --- a/evm/src/memory/segments.rs +++ b/evm/src/memory/segments.rs @@ -1,7 +1,22 @@ +/// Contains EVM bytecode. pub const CODE: usize = 0; -pub const STACK: usize = 1; -pub const MAIN_MEM: usize = 2; -pub const CALLDATA: usize = 3; -pub const RETURNDATA: usize = 4; -pub const NUM_SEGMENTS: usize = 5; +pub const STACK: usize = 1; + +/// Main memory, owned by the contract code. +pub const MAIN_MEM: usize = 2; + +/// Memory owned by the kernel. +pub const KERNEL_MEM: usize = 3; + +/// Data passed to the current context by its caller. +pub const CALLDATA: usize = 4; + +/// Data returned to the current context by its latest callee. +pub const RETURNDATA: usize = 5; + +/// A segment which contains a few fixed-size metadata fields, such as the caller's context, or the +/// size of `CALLDATA` and `RETURNDATA`. +pub const METADATA: usize = 6; + +pub const NUM_SEGMENTS: usize = 7;