Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
HermitOS
kernel
Commits
806ceb0f
Commit
806ceb0f
authored
2 years ago
by
Martin Kröning
Browse files
Options
Downloads
Patches
Plain Diff
Uhyve: Cast argv, env ptrs before pushing
parent
5d5f6923
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/syscalls/interfaces/uhyve.rs
+9
-13
9 additions, 13 deletions
src/syscalls/interfaces/uhyve.rs
with
9 additions
and
13 deletions
src/syscalls/interfaces/uhyve.rs
+
9
−
13
View file @
806ceb0f
...
...
@@ -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
)
->
!
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment