fn ecall(cpu: &mut Cpu, addr: u64, _word: u32) -> Result<(), Trap> {
    Err(Trap {
        exception: match cpu.privilege {
            Privilege::User => Exception::EnvironmentCallFromUMode,
            Privilege::Supervisor => Exception::EnvironmentCallFromSMode,
            Privilege::Hypervisor => panic!("Hypervisor is not supported!"),
            Privilege::Machine => Exception::EnvironmentCallFromMMode,
        },
        value: addr,
    })
}
//==============================================================================
// Environment Call and Breakpoints
//==============================================================================
/// [ecall]
Environment Call and Breakpoints
[ecall]
Environment Call and Breakpoints [ ecall ]
fn ecall(cpu: &mut Cpu, addr: u64, _word: u32) -> Result<(), Trap> {
    Err(Trap {
        exception: match cpu.privilege {
            Privilege::User => Exception::EnvironmentCallFromUMode,
            Privilege::Supervisor => Exception::EnvironmentCallFromSMode,
            Privilege::Hypervisor => panic!("Hypervisor is not supported!"),
            Privilege::Machine => Exception::EnvironmentCallFromMMode,
        },
        value: addr,
    })
}
fn ecall ( cpu : & mut Cpu , addr : u64 , _word : u32 ) -> Result < ( ) , Trap > { Err ( Trap { exception : match cpu . privilege { Privilege :: User => Exception :: EnvironmentCallFromUMode , Privilege :: Supervisor => Exception :: EnvironmentCallFromSMode , Privilege :: Hypervisor => panic ! ( " " ) , Privilege :: Machine => Exception :: EnvironmentCallFromMMode , } , value : addr , } ) }
Environment Call and Breakpoints
[ecall]
Environment Call and Breakpoints [ ecall ]
cpu
&mut Cpu
addr
u64
_word
u32