Skip to content

Commit

Permalink
Avoid an unnecessary push/pop in the x86 indirect_syscall5 path.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Feb 18, 2022
1 parent 95b301b commit b233ea8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/imp/linux_raw/arch/inline/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,13 @@ pub(in crate::imp) unsafe fn indirect_syscall5(
// registers free. Use eax as a temporary pointer to a slice, since it
// gets clobbered as the return value anyway.
asm!(
"push ebp",
"push esi",
"push DWORD PTR [eax + 0]",
"mov esi, DWORD PTR [eax + 4]",
"mov eax, DWORD PTR [eax + 8]",
"call DWORD PTR [esp]",
"pop esi",
"pop esi",
"pop ebp",
inout("eax") &[callee as usize, a3.to_asm(), nr.to_asm()] => r0,
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
Expand Down

0 comments on commit b233ea8

Please sign in to comment.