mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-05-22 01:39:25 +00:00
UserspaceProgramCounter
This commit is contained in:
parent
3f08cca116
commit
be0a5269ab
@ -5,17 +5,20 @@ pub(crate) enum ContextMetadata {
|
|||||||
ParentContext = 0,
|
ParentContext = 0,
|
||||||
/// The program counter to return to when we return to the parent context.
|
/// The program counter to return to when we return to the parent context.
|
||||||
ParentProgramCounter = 1,
|
ParentProgramCounter = 1,
|
||||||
CalldataSize = 2,
|
/// If we're in a system call, this holds the userspace program counter to return to.
|
||||||
ReturndataSize = 3,
|
UserspaceProgramCounter = 2,
|
||||||
|
CalldataSize = 3,
|
||||||
|
ReturndataSize = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ContextMetadata {
|
impl ContextMetadata {
|
||||||
pub(crate) const COUNT: usize = 4;
|
pub(crate) const COUNT: usize = 5;
|
||||||
|
|
||||||
pub(crate) fn all() -> [Self; Self::COUNT] {
|
pub(crate) fn all() -> [Self; Self::COUNT] {
|
||||||
[
|
[
|
||||||
Self::ParentContext,
|
Self::ParentContext,
|
||||||
Self::ParentProgramCounter,
|
Self::ParentProgramCounter,
|
||||||
|
Self::UserspaceProgramCounter,
|
||||||
Self::CalldataSize,
|
Self::CalldataSize,
|
||||||
Self::ReturndataSize,
|
Self::ReturndataSize,
|
||||||
]
|
]
|
||||||
@ -26,6 +29,7 @@ impl ContextMetadata {
|
|||||||
match self {
|
match self {
|
||||||
ContextMetadata::ParentContext => "CTX_METADATA_PARENT_CONTEXT",
|
ContextMetadata::ParentContext => "CTX_METADATA_PARENT_CONTEXT",
|
||||||
ContextMetadata::ParentProgramCounter => "CTX_METADATA_PARENT_PC",
|
ContextMetadata::ParentProgramCounter => "CTX_METADATA_PARENT_PC",
|
||||||
|
ContextMetadata::UserspaceProgramCounter => "CTX_METADATA_USERSPACE_PC",
|
||||||
ContextMetadata::CalldataSize => "CTX_METADATA_CALLDATA_SIZE",
|
ContextMetadata::CalldataSize => "CTX_METADATA_CALLDATA_SIZE",
|
||||||
ContextMetadata::ReturndataSize => "CTX_METADATA_RETURNDATA_SIZE",
|
ContextMetadata::ReturndataSize => "CTX_METADATA_RETURNDATA_SIZE",
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user