Skip to content

Commit fcfd6ec

Browse files
committed
[feat] introduce set_return_value API
1 parent 1df97f2 commit fcfd6ec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/exception.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use aarch64_cpu::registers::{ESR_EL2, HCR_EL2, Readable, SCTLR_EL1, VTCR_EL2, VTTBR_EL2};
22

3-
use axaddrspace::GuestPhysAddr;
3+
use axaddrspace::{GuestPhysAddr, device::AccessWidth};
44
use axerrno::{AxError, AxResult};
5-
use axvcpu::{AccessWidth, AxVCpuExitReason};
5+
use axvcpu::AxVCpuExitReason;
66

77
use crate::TrapFrame;
88
use crate::exception_utils::{

src/vcpu.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ impl<H: AxVCpuHal> axvcpu::AxArchVCpu for Aarch64VCpu<H> {
121121
fn set_gpr(&mut self, idx: usize, val: usize) {
122122
self.ctx.set_gpr(idx, val);
123123
}
124+
125+
fn set_return_value(&mut self, val: usize) {
126+
// Return value is stored in x0.
127+
self.ctx.set_argument(val);
128+
}
124129
}
125130

126131
// Private function

0 commit comments

Comments
 (0)