ArchIndependentRegs

Trait ArchIndependentRegs 

Source
trait ArchIndependentRegs {
    // Required methods
    fn ip(&self) -> usize;
    fn set_ip(&mut self, ip: usize);
    fn set_sp(&mut self, sp: usize);
}
Expand description

Allows us to get common arguments from the user_regs_t across architectures. Normally this would land us ABI hell, but thankfully all of our usecases consist of functions with a small number of register-sized integer arguments. See https://man7.org/linux/man-pages/man2/syscall.2.html for sources.

Required Methods§

Source

fn ip(&self) -> usize

Gets the address of the instruction pointer.

Source

fn set_ip(&mut self, ip: usize)

Set the instruction pointer; remember to also set the stack pointer, or else the stack might get messed up!

Source

fn set_sp(&mut self, sp: usize)

Set the stack pointer, ideally to a zeroed-out area.

Implementations on Foreign Types§

Source§

impl ArchIndependentRegs for user_regs_struct

Source§

fn ip(&self) -> usize

Source§

fn set_ip(&mut self, ip: usize)

Source§

fn set_sp(&mut self, sp: usize)

Implementors§