Skip to content

Commit

Permalink
通过check fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
MemoryShore committed Aug 29, 2024
1 parent 421d3ae commit 2207c1c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/src/process/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,12 @@ impl ProcInitInfo {
// 实现栈的16字节对齐,如果argv、envp、argc在栈中的长度加起来不能对齐16字节,则手动填充一个空字节
// TODO 感觉这样对齐有点简陋,后续可能要完善一下
if (envps.len() + argps.len() + 1) * core::mem::align_of::<usize>() % 0x10 != 0 {
self.push_slice(ustack, &vec![0u8; 1])?;
self.push_slice(ustack, &[0u8; 1])?;
}

// 压入auxv
self.push_slice(ustack, &[null::<u8>(), null::<u8>()])?;
for (&k, &v) in self.auxv.iter() {
log::debug!("auxv: {:?}", ustack.sp());
self.push_slice(ustack, &[k as usize, v])?;
}

Expand Down

0 comments on commit 2207c1c

Please sign in to comment.