Skip to content

Commit

Permalink
Untested add of the file hypercall functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jounathaen committed Apr 3, 2024
1 parent f4426fd commit 3768b34
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/macos/aarch64/vcpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
PSR, TCR_FLAGS, TCR_TG1_4K, VA_BITS,
},
consts::*,
hypercall,
hypercall::{self, copy_argv, copy_env},
vcpu::{VcpuStopReason, VirtualCPU},
vm::UhyveVm,
HypervisorResult,
Expand Down Expand Up @@ -174,6 +174,31 @@ impl VirtualCPU for XhyveCpu {
Hypercall::Exit(sysexit) => {
return Ok(VcpuStopReason::Exit(sysexit.arg));
}
Hypercall::Cmdsize(syssize) => syssize
.update(self.parent_vm.kernel_path(), self.parent_vm.args()),
Hypercall::Cmdval(syscmdval) => {
copy_argv(
self.parent_vm.kernel_path().as_os_str(),
self.parent_vm.args(),
syscmdval,
&self.parent_vm.mem,
);
copy_env(syscmdval, &self.parent_vm.mem);
}
Hypercall::FileClose(sysclose) => hypercall::close(sysclose),
Hypercall::FileLseek(syslseek) => hypercall::lseek(syslseek),
Hypercall::FileOpen(sysopen) => {
hypercall::open(&self.parent_vm.mem, sysopen)
}
Hypercall::FileRead(sysread) => {
hypercall::read(&self.parent_vm.mem, sysread)
}
Hypercall::FileWrite(syswrite) => {
hypercall::write(&self.parent_vm.mem, syswrite).unwrap()
}
Hypercall::FileUnlink(sysunlink) => {
hypercall::unlink(&self.parent_vm.mem, sysunlink)
}
_ => {
panic! {"Hypercall {hypercall:?} not implemented on macos-aarch64"}
}
Expand Down

0 comments on commit 3768b34

Please sign in to comment.