Skip to content

Commit

Permalink
Port to main.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Dec 13, 2024
1 parent 3da5aac commit cf2a975
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pulley/src/interp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ impl Vm {
self.state.fp
}

/// Returns the current `sp` register value.
pub fn sp(&self) -> *mut u8 {
self.state.sp
}

/// Returns the current `lr` register value.
pub fn lr(&self) -> *mut u8 {
self.state.lr
Expand Down Expand Up @@ -578,6 +583,7 @@ pub struct MachineState {
f_regs: [FRegVal; FReg::RANGE.end as usize],
v_regs: [VRegVal; VReg::RANGE.end as usize],
fp: *mut u8,
sp: *mut u8,
lr: *mut u8,
stack: Vec<u8>,
done_reason: Option<DoneReason<()>>,
Expand All @@ -595,6 +601,7 @@ impl fmt::Debug for MachineState {
stack: _,
done_reason: _,
fp: _,
sp: _,
lr: _,
} = self;

Expand Down Expand Up @@ -676,6 +683,7 @@ impl MachineState {
stack,
done_reason: None,
fp: HOST_RETURN_ADDR,
sp: HOST_RETURN_ADDR,
lr: HOST_RETURN_ADDR,
};

Expand Down

0 comments on commit cf2a975

Please sign in to comment.