Skip to content
Snippets Groups Projects
Commit 806ceb0f authored by Martin Kröning's avatar Martin Kröning :crab:
Browse files

Uhyve: Cast argv, env ptrs before pushing

parent 5d5f6923
No related branches found
No related tags found
No related merge requests found
......@@ -141,10 +141,10 @@ impl SyscallInterface for Uhyve {
let mut argv = Box::new(Vec::with_capacity(syscmdsize.argc as usize));
let mut argv_phy = Vec::with_capacity(syscmdsize.argc as usize);
for i in 0..syscmdsize.argc as usize {
argv.push(crate::__sys_malloc(
syscmdsize.argsz[i] as usize * mem::size_of::<u8>(),
1,
));
argv.push(
crate::__sys_malloc(syscmdsize.argsz[i] as usize * mem::size_of::<u8>(), 1)
.cast_const(),
);
argv_phy.push(
paging::virtual_to_physical(VirtAddr(argv[i] as u64))
.unwrap()
......@@ -156,10 +156,10 @@ impl SyscallInterface for Uhyve {
let mut env = Box::new(Vec::with_capacity(syscmdsize.envc as usize + 1));
let mut env_phy = Vec::with_capacity(syscmdsize.envc as usize + 1);
for i in 0..syscmdsize.envc as usize {
env.push(crate::__sys_malloc(
syscmdsize.envsz[i] as usize * mem::size_of::<u8>(),
1,
));
env.push(
crate::__sys_malloc(syscmdsize.envsz[i] as usize * mem::size_of::<u8>(), 1)
.cast_const(),
);
env_phy.push(
paging::virtual_to_physical(VirtAddr(env[i] as u64))
.unwrap()
......@@ -176,11 +176,7 @@ impl SyscallInterface for Uhyve {
let (argv_ptr, _, _) = argv.into_raw_parts();
let (env_ptr, _, _) = env.into_raw_parts();
(
syscmdsize.argc,
argv_ptr as *const *const u8,
env_ptr as *const *const u8,
)
(syscmdsize.argc, argv_ptr, env_ptr)
}
fn shutdown(&self, arg: i32) -> ! {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment