Skip to content

Commit ad5d5db

Browse files
committed
feat: 添加 ctx 和 ctx_mut 方法以访问和修改 TrapFrame
1 parent 012bc4c commit ad5d5db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/vcpu.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ impl Aarch64VCpu {
141141
// Return value is stored in x0.
142142
self.ctx.set_argument(val);
143143
}
144+
145+
pub fn ctx(&self) -> &TrapFrame {
146+
&self.ctx
147+
}
148+
149+
pub fn ctx_mut(&mut self) -> &mut TrapFrame {
150+
&mut self.ctx
151+
}
144152
}
145153

146154
// Private function

0 commit comments

Comments
 (0)