35 lines
1.3 KiB
Rust
35 lines
1.3 KiB
Rust
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub enum LoaderPatchError {
|
|
DecodeFailed(prometeu_bytecode::DecodeError),
|
|
ResolveFailed(prometeu_hal::syscalls::DeclaredLoadError),
|
|
RawSyscallInPreloadArtifact { pc: usize, syscall_id: u32 },
|
|
HostcallIndexOutOfBounds { pc: usize, sysc_index: u32, syscalls_len: usize },
|
|
UnusedSyscallDecl { sysc_index: u32, module: String, name: String, version: u16 },
|
|
HostcallRemaining { pc: usize, sysc_index: u32 },
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub enum VmInitError {
|
|
RegistryLoadFailed(prometeu_bytecode::load_limits::LoadFailure),
|
|
RuntimeResourceLimit(crate::resource_budget::ResourceFailure),
|
|
InvalidFormat,
|
|
UnsupportedFormat,
|
|
ImageLoadFailed(prometeu_bytecode::LoadError),
|
|
LoaderPatchFailed(LoaderPatchError),
|
|
EntrypointNotFound,
|
|
EntrypointArgumentsInvalid { function: u32, slot: u32, trap_code: u32 },
|
|
VerificationFailed(crate::verifier::VerifierError),
|
|
}
|
|
|
|
impl From<crate::resource_budget::ResourceFailure> for VmInitError {
|
|
fn from(value: crate::resource_budget::ResourceFailure) -> Self {
|
|
Self::RuntimeResourceLimit(value)
|
|
}
|
|
}
|
|
|
|
impl From<prometeu_bytecode::load_limits::LoadFailure> for VmInitError {
|
|
fn from(value: prometeu_bytecode::load_limits::LoadFailure) -> Self {
|
|
Self::RegistryLoadFailed(value)
|
|
}
|
|
}
|